ntp time synchronization configuration

ntp time synchronization configuration

After the Hadoop cluster is set up, let's do the time zone synchronization first
. Use the following command to install ntp on all three virtual machines

yum -y install ntp

Then use the following command to set ntp to start automatically on the three machines

chkconfig ntpd on

Modify the host's ntp.conf file below

vi /etc/ntp.conf

Insert picture description here
As shown in the figure, uncomment restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap.
Comment out the four lines server as shown in the figure and add it below:

server 127.127.1.0
fudge 127.127.1.0 stratum 10

The modification of the other two ntp.conf is the same as follows:
Insert picture description here
Uncomment restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap as shown in the figure.
Also comment out the four lines of server and add it below:

server 127.127.1.0
fudge 127.127.1.0 stratum 10
server hadoop001
restrict hadoop001 nomodify notrap noquery

Where hadoop001 is your hostname or IP address

Start the ntp service:

service ntpd start

Enter the following commands on the three virtual machines to view the time synchronization results:

ntpstat

Insert picture description here
The above figure synchronised to NTP server appears after the three virtual machines execute the command, that is, the time synchronization is successful.

Guess you like

Origin blog.csdn.net/giantleech/article/details/115091469