Set Server Time

1. | Log in as root. |
2. | Check if the current server time reflects the local time zone using the date command, as follows. |
date
3. | To check for a nearby city with the correct time zone, use the timedatectl list-timezones command. |
For example, the following command finds time zones in Asia:
timedatectl list-timezones | grep Asia
4. | To change the server time to local time, use the timedatectl set-timezone command. |
Example:
timedatectl set-timezone Asia/Singapore
5. | To make sure that the server time has changed, enter the following command: |
ls -l /etc/localtime

1. | Log in as root. |
2. | Check if chrony daemon is running. Enter: |
systemctl status chronyd
3. | If the result from the previous command shows inactive or dead, enable the chrony daemon. Enter: |
systemctl enable chronyd
4. | To start the daemon, enter: |
systemctl start chronyd
5. | Edit /etc/chrony.conf using vi. Enter: |
vi /etc/chrony.conf
6. | Replace the default NTP server settings to the local NTP server. |
Original default settings:
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
Settings to use local NTP server(s):
server 192.168.1.1 iburst
server 192.168.1.2 iburst
7. | To save the file, enter: |
:wq!
8. | To restart the chrony daemon, enter: |
systemctl restart chronyd
9. | Check the health of the local time server as follows. |
timedatectl
10. | To make sure that DRAGEN Server can synchronize with the local NTP server, use one of the following commands: |
• | chronyc tracking (Manual) |
• | ntpdate (Automatic) |
The following is an example command:
ntpdate -q 192.168.1.1