NTP 시간 동기화 환경 설정하기 – Linux, windows
Windows
C:\\>net time /setsntp:\”192.168.123.199 192.168.123.200\”
명령을 잘 실행했습니다.
C:\\>net time /querysntp
현재 SNTP 값: 192.168.123.199 192.168.123.200
명령을 잘 실행했습니다.
C:\\>
Linux
[root@NODE01 modules]# cat /etc/ntp.conf
server 172.18.56.45
driftfile /etc/ntp/drift
multicastclient
broadcastdelay 0.008
authenticate no
keys /etc/ntp/keys
trustedkey 65535
requestkey 65535
controlkey 65535
[root@NODE01 modules]# cat /etc/ntp/
drift keys ntpservers step-tickers
[root@NODE01 modules]# cat /etc/ntp/drift
7.467
[root@NODE01 modules]# cat /etc/ntp/keys
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
#65535 M akey
#1 M pass
[root@NODE01 modules]# cat /etc/ntp/ntpservers
clock.redhat.com
clock2.redhat.com
[root@NODE01 modules]# cat /etc/ntp/step-tickers
172.18.56.45
[root@NODE01 modules]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*NODEFM01 LOCAL(0) 11 u 56 64 377 0.134 -4.611 2.989
POSCO NTP Server
192.168.123.199
192.168.123.200
[root@NODE01 modules]# cat /etc/ntp.conf
server 192.168.123.199
restrict 192.168.123.199 mask 255.255.255.255 nomodify notrap noquery
server 192.168.123.200
restrict 192.168.123.200 mask 255.255.255.255 nomodify notrap noquery
[root@NODE01 modules]# cat /etc/ntp/step-tickers
192.168.123.199
192.168.123.200
[root@NODE01 modules]# /etc/init.d/ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]
[root@NODE01 modules]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.123.199 .GPS. 1 u 2 64 1 6.532 0.422 0.001
192.168.123.200 .GPS. 1 u 1 64 1 6.743 0.632 0.001