Water's Home

Just another Life Style

0%

Create Local NTP

Controller node

Install Chrony

[root@localhost ~]# yum install chrony -y

Edit the /etc/chrony.conf file

[root@localntp ~]# diff /etc/chrony.conf /etc/chrony.conf_bak
3,7c3,6
< #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
< server 192.168.220.201 iburst


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
28d26
< allow 192.168.220.0/24

Start the NTP service

[root@localhost ~]# systemctl enable chronyd.service
[root@localhost ~]# systemctl start chronyd.service
[root@localhost ~]# systemctl restart chronyd.service

Other nodes

Install Chrony

[root@localhost ~]# yum install chrony -y

Edit the /etc/chrony.conf file

[root@localhost ~]# diff /etc/chrony.conf /etc/chrony.conf_bak
3,7c3,6
< #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
< server 192.168.220.201 iburst


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

Start the NTP service

[root@localhost ~]# systemctl enable chronyd.service
[root@localhost ~]# systemctl start chronyd.service
[root@localhost ~]# systemctl restart chronyd.service

Verify operation

controller node

[root@localhost ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? localhost.localdomain 0 8 0 - +0ns[ +0ns] +/- 0ns

other nodes

[root@localhost ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? 192.168.220.201 0 8 0 - +0ns[ +0ns] +/- 0ns