Setting Up NTP (Network Time Protocol)
NTP (Network Time Protocol) is a protocol which allows computers to synchronize time.
NTPd is a daemon that maintains the system time in synchronization with other NTP servers
1) Configure TimeZone
Before anything else, you need to assign the correct time zone.
To get the current configuration, type:
# timedatectl
If you wish to change the timezone please follow following steps.
# timedatectl list-timezones
To set your time zone you can use command below: (e.g. Athens Greece)
# timedatectl set-timezone Europe/Athens
2) Install NTPD
Now you need to install the NTPD service at boot:
NTP package is provided by default from RHEL repositories, and can be installed running the following command.
# yum install ntp
Activate the NTP service at boot:
# systemctl enable ntpd
Start the NTP service:
# systemctl start ntpd
3) NTP configuration:
# vi /etc/ntp.conf
Check the followings.
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
To get some information about the time synchronization process, type:
# ntpq -p
Alternatively, to get a basic report, type:
# ntpstat
To quickly synchronize with external server, type:
# systemctl stop ntpd
# ntpdate pool.ntp.org
4 Apr 09:53:22 ntpdate[6549]: adjust time server xxx.xxx.xxx.xxx offset -0.000160 sec
# systemctl start ntpd
NTP (Network Time Protocol) is a protocol which allows computers to synchronize time.
NTPd is a daemon that maintains the system time in synchronization with other NTP servers
1) Configure TimeZone
Before anything else, you need to assign the correct time zone.
To get the current configuration, type:
# timedatectl
If you wish to change the timezone please follow following steps.
# timedatectl list-timezones
To set your time zone you can use command below: (e.g. Athens Greece)
# timedatectl set-timezone Europe/Athens
2) Install NTPD
Now you need to install the NTPD service at boot:
NTP package is provided by default from RHEL repositories, and can be installed running the following command.
# yum install ntp
Activate the NTP service at boot:
# systemctl enable ntpd
Start the NTP service:
# systemctl start ntpd
3) NTP configuration:
# vi /etc/ntp.conf
Check the followings.
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
To get some information about the time synchronization process, type:
# ntpq -p
Alternatively, to get a basic report, type:
# ntpstat
To quickly synchronize with external server, type:
# systemctl stop ntpd
# ntpdate pool.ntp.org
4 Apr 09:53:22 ntpdate[6549]: adjust time server xxx.xxx.xxx.xxx offset -0.000160 sec
# systemctl start ntpd