서버의 로컬 시간 시계가 어떻게 네트워크의 NTP 시간 소스가 될 수 있습니까?

서버의 로컬 시간 시계가 어떻게 네트워크의 NTP 시간 소스가 될 수 있습니까?

Stratum 1 서버의 로컬 시계를 내 네트워크의 네트워크 시간 소스로 만들고 싶습니다(안테나가 있는 Stratum 0 서버는 원하지 않습니다). 네트워크에서 어떻게 설정할 수 있나요? 네트워크 시간 프로토콜을 사용하고 설정하는 방법을 설명하는 튜토리얼이 있습니까? 나는 이것을 달성하는 방법에 대해 지금까지 Google에서 아무것도 찾지 못했습니다. 도와주시면 정말 감사하겠습니다.

답변1

범용 컴퓨터의 시계는 최신 장치에서 기대되는 정확도에 비해 쓰레기입니다. 정확하게 보정되지 않았으며 서버의 열 변화로 인해 드리프트가 달라질 수 있습니다. 따라서 업데이트하려면 몇 가지 방법이 필요합니다. 그렇지 않으면 극단적인 경우 몇 분 단위로 부정확해집니다. 때로는 시계가 일치하는 것만으로도 충분하지만 사람들은 더 나은 것을 기대하는 경향이 있습니다.

실용적인 구성을 진행합니다. 예를 들어 Linux에서는 chrony가 널리 사용되며 시계를 수동으로 설정하고 연결 끊김을 처리하는 기능이 있습니다. 다음과 같은 예부터 시작하세요.시간 관리에 대한 RHEL 문서, 참고로 크로니 매뉴얼을 참조하세요.

대부분의 시간 서버에는 인터넷 액세스, 위성 항법 안테나 또는 정확한 시계 하드웨어 중 하나 이상이 있습니다. 기본적으로 chrony는 NTP를 통해 참조 시계에서 나오는 경우 시간을 제공합니다. 네트워크에 허용 지시문을 설정하고 NTP 서버를 사용하십시오. 그러나 이들 중 어느 것도 없으면 로컬 지시문을 사용하여 어쨌든 chrony가 시간을 제공하도록 만들 수 있습니다.

이것이 실제로 시간 하드웨어가 없는 에어갭 네트워크인 경우 manual 지시어도 활성화하여 를 사용하여 수동으로 시간을 알릴 수 있습니다 chronyc settime.

chrony.conf, NTP 서버에 사용할 수 있는 것에 대한 설명, EL 기본 구성에서 내가 좋아하는 몇 가지 사항:

# chrony.conf that still serves time if not syncronized 

# Options for time sources

# NTP appliance
# For example, sat nav modules are inexpensive
# Assuming it is available over IP, it is an NTP server
#server time.zone.example.net iburst

# Isolated computers need software updates too!
# If there is an update server on the local net via IP,
# it can serve NTP as well as patches
#server updateproxy.example.net iburst

# Public internet NTP
# Use if you actually have internet
# But no local time source somehow
#pool 2.pool.ntp.org iburst


# Pretend local clock is syncronized
# Enabling serving time
# Use a high stratum, as a lower priority over better clocks 
local stratum 10

# Allow "chronyc settime"
# Run this with input time based on e.g. a watch or other clock
# Regularly and when the time is wrong
manual

# Allow clients to query this server
# Replace with your local net prefix
allow 2001:db8:2ea1::/48


### End source customization
### Begin other configuration

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

logdir /var/log/chrony
log measurements statistics tracking

관련 정보