Configure time synchronization with an external NTP server
Configuring time synchronization by protocol NTP is required when you're Prepare your ISO image to work with the cloud platform.
В ready-made images cloud servers, all necessary settings for NTP synchronization are made.
Linux
Windows
1. Check the installed utility
-
Check which utility is being used on the server:
systemctl status ntp
systemctl status chronyd
systemctl status systemd-timesyncdWe recommend the use of
Chrony
But you can customize the utility that is already installed on the server. -
If you want to go to
Chrony
disable and uninstall the utilitiessystemd-timesyncd
andntpd
and setChrony
:systemctl disable <name>
sudo apt remove <name>
sudo apt-get install chronydSpecify
<name>
— the name of the utility to be deleted (ntp
orsystemd-timesyncd
).
2. Customize the utility
Chrony
ntpd
systemd-timesyncd
-
Run
Chrony
:systemctl start chronyd
-
Open the configuration file
Chrony
word processingvi
:vi /etc/chrony/chrony.conf
-
Add or replace the NTP servers in the file. We recommend replacing the servers in the file with Servercore NTP servers But you can specify any available NTP servers.
server <ntp_server> iburst
Specify
<ntp_server>
— domain name or IP address of the NTP server. -
Exit the text editor
vi
with the changes intact::wq
-
Restart the utility
Chrony
:sudo systemctl restart chronyd
-
Check the list of NTP servers in use:
chronyc -N sources
-
Open the configuration file
ntpd
word processingvi
:vi /etc/ntp.conf
-
Add or replace the NTP servers in the file. We recommend replacing the servers in the file with Servercore NTP servers But you can specify any available NTP servers.
server <ntp_server> iburst
Specify
<ntp_server>
— domain name or IP address of the NTP server. -
Exit the text editor
vi
with the changes intact::wq
-
Restart the utility
ntpd
:sudo systemctl restart ntpd
-
Check the list of NTP servers in use:
ntpq -p
-
Open the configuration file
ntpd
word processingvi
:vi /etc/systemd/timesyncd.conf
-
In the parameter
NTP
add or replace NTP servers. We recommend replacing the servers with Servercore NTP servers But you can specify any available NTP servers.NTP=<ntp_server>
Specify
<ntp_server>
— domain name or IP address of the NTP server. -
Exit the text editor
vi
with the changes intact::wq
-
Restart the utility
systemd-timesyncd
:sudo systemctl restart systemd-timesyncd.service
-
Check that the utility is running and the time is synchronized:
timedatectl status
In the reply, in the field
NTP service
should appearactive
in the fieldSystem clock synchronized
—yes
.
-
Open the CLI.
-
Stop the Windows time service:
net stop w32time
-
Specify the NTP servers. We recommend replacing the servers with Servercore NTP servers But you can specify any available NTP servers.
w32tm /config /syncfromflags:manual /manualpeerlist:"<ntp_server>" /update
Specify
<ntp_server>
— domain name or IP address of the NTP server. -
Start the Windows Time Service:
net start w32time
-
Check the list of NTP servers in use:
w32tm /query /peers