[Linux, Windows] Time synchronization setting / confirmation

Time synchronization settings for each OS.

RHEL/CentOS The confirmed version is 7.4. Up to 6, it was ntpd, but now chronyd is used.

Status check

systemctl status chronyd

If you can't, install YUM

yum install chrony

Auto start setting

systemctl enable chronyd

Reference setting

The configuration file is /etc/chrony.conf </ font>. By default, there are the following items, so comment them out.

/etc/chrony.conf 


#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

So, add the following

/etc/chrony.conf 


server [NTP server] iburst
port 0

ʻIburstis an option to make inquiries four times immediately after startup to speed up synchronization. port0` is an option that" only works as a client ".

chronyd restart

systemctl restart chronyd

Confirmation ①

chronyc sources

If there is a * on the left side of the synchronization destination IP address, it is OK.

Confirmation ②

timedatectl

NTP enabled: yes NTP synchronized: yes

Is displayed, it is OK.
Debian/Ubuntu Confirmed version is 16.04 Systemd-timesyncd is used here.

Status check

systemctl -l status systemd-timesyncd

Settings are made in /etc/systemd/timesyncd.conf </ font>.

/etc/systemd/timesyncd.conf


[Time]
NTP=[NTP server]
FallbackNTP=[NTP server]

It is a setting to synchronize to FallbackNTP = when synchronization with NTP = is not successful.

Confirmation ①

systemctl -l status systemd-timesyncd

Status: to Synchronized to time server [NTP server] Is displayed, it is OK.

Confirmation ②

timedatectl

NTP enabled: yes NTP synchronized: yes Is displayed, it is OK.

Windows The confirmed version is 2012 R2, which can also be done in 2016.

Setting

[Control panel]→[Clock, language, and region]
[Date and time settings]→[Internet time]

20180516183802.jpg Enter the IP address or host name of the destination server in the Server box Click Update Now.

Verification

Open a command prompt as an administrator and execute the following command.

w32tm /monitor /computers:[NTP server]
w32tm /query /status /verbose

OK if the settings are reflected in the status. You can also check the last synchronization time and delay. By the way, if you participate in Activce Directory, it will automatically refer to the domain controller.

Real-time confirmation

w32tm /stripchart /computer:[NTP server]

20180516183820.jpg Move the @ on the chart to the middle and wait until it changes to *.

w32tm /resync

Resynchronize with.

w32tm /monitor /computers:[NTP server]

Reconfirmed with.
Of course, the larger the difference between the set time and the synchronization destination time, the longer it will take. If it is too far away, an error will occur, so When setting, let's make it as close as possible by manually setting the time.

Recommended Posts