문맥

문맥

문맥

  • 센토스 7
  • chronyd (chrony) 버전 3.1

질문

chonyd서버 날짜 문제가 있습니다 .

먼저 현재 날짜를 이전 날짜로 변경합니다.

다음 명령을 mar. nov. 27 15:57:12 CET 2018사용하여 현재 실제 날짜에서 하드웨어 시계 날짜를 변경했습니다 .mer. déc. 12 12:12:12 CET 2012

hwclock --set --date="12/12/2012 12:12:12"
hwclock -s

그런 다음 실제 좋은 날짜를 얻으려면 chronyd 서비스를 시작하십시오.

를 사용하여 chronyd 서비스를 시작 systemctl start chronyd하고 를 사용하여 상태를 확인했습니다 systemctl status chronyd. 다음 출력은 chronyd서비스가 올바르게 실행되고 있음을 보여줍니다.

● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since mer. 2012-12-12 12:20:14 CET; 27min ago

...

déc. 12 12:20:17 pad chronyd[1808]: Selected source 178.32.220.7
déc. 12 12:20:17 pad chronyd[1808]: System clock wrong by 188017778.899985 seconds, adjustment started
déc. 12 12:25:37 pad chronyd[1808]: Selected source 62.210.211.218

/etc/chrony.conf구성 파일 은 다음과 같습니다 .

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

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

# Enable hardware timestamping on all interfaces that support it.
hwtimestamp *

# Specify directory for log files.
logdir /var/log/chrony

server 0.fr.pool.ntp.org minpoll 0 maxpoll 0
server 1.fr.pool.ntp.org minpoll 0 maxpoll 0
server 2.fr.pool.ntp.org minpoll 0 maxpoll 0
server 3.fr.pool.ntp.org minpoll 0 maxpoll 0

chronyc sources시작 후 출력 은 다음 과 같습니다 chronyd.

^+ obelix.fraho.eu               2   0   377     0   -876us[ -876us] +/-   12ms
^- bb8.dousse.eu                 2   7   377    40  -1547us[-1547us] +/-   52ms
^- cdg1.m-d.net                  2   6   377    39   -806us[ -806us] +/-   33ms
^* cluster004.linocomm.net       2   7   377   100   +330us[ +384us] +/- 7957us

출력은 서버가 연결되었음을 나타내고 ^+ntp 호스트 서버의 문자를 표시합니다.obelix.fraho.eu

마지막으로 chronyd 데몬이 날짜를 업데이트하고 날짜를 표시할 때까지 기다립니다.

date60분 이상 후에 터미널에서 명령을 실행하여 다음과 같은 결과를 얻었습니다.

mer. déc. 12 13:15:04 CET 2012

chronyd는 아직 날짜를 업데이트하지 않았습니다 ...

폴더 /var/log/chronyd/가 비어 있습니다.

어떤 아이디어가 있나요?

답변1

인용하다공식 FAQ, chronyd시계를 점진적으로 조정합니다.

기본적으로 chronyd는 시계 속도를 늦추거나 높여 시계를 점진적으로 조정합니다. 시계가 실제 시간과 너무 멀리 떨어져 있으면 오류를 수정하는 데 오랜 시간이 걸립니다. chronyc의 추적 명령으로 인쇄된 시스템 시간 값은 시스템 시계에 적용되어야 하는 나머지 수정 사항입니다.

여기에 설명된 대로 시계를 확인할 수 있습니다.System time조정은 실제로 출력 라인을 확인하여 이루어집니다 chronyc tracking( 자세한 내용 tracking은 섹션 참조 man chronyc).

chronyd시계의 단계를 변경 하려면 다음 makestep위치에 지침을 추가 해야 합니다 chrony.conf.

# Step the clock on the first three updates
# if its offset is larger than one second
makestep 1 3

chronyd일시 중지하고 다시 시작할 수 있는 VM과 같이 시작 후 첫 번째 업데이트뿐 아니라 모든 업데이트에 대한 시간을 확인 하고 싶을 수도 있습니다 .

# Step the clock on any update 
# if its offset is larger than one second
makestep 1 -1

man chronyc하지만 공식 문서(또한 ) 의 경고를 기억하세요 .

[...] 시간 점프는 일부 응용 프로그램에 부정적인 결과를 초래할 수 있습니다.

관련 정보