Cloud computing projects such as Greenplum,openstack require Cluster Server deployment, and time between servers needs to be synchronized, but not all machines can
Directly connected to the network, this can be solved with chrony tools.
The workaround is to set one of them as a time server, and then synchronize the other servers with this time server.
I. Configuring a TIME server
Select a server with IP as 10.168.10.10
First install the Chrony tool (Ubuntu system, other systems on the official website has the installation method)
sudo apt-get install Chrony
To edit a configuration file:
sudo vi/etc/chrony/chrony.conf
Find the content below
Server 0.debian.pool.ntp.org offline Minpoll 8server 1.debian.pool.ntp.org offline Minpoll 8server 2. debian.pool.ntp.org offline Minpoll 8server 3.debian.pool.ntp.org offline Minpoll 8
Modify it to:
Server 1.cn.pool.ntp.orgserver 1.asia.pool.ntp.orgserver 0.asia.pool.ntp.org
Locate and modify the following content for your own IP segment, the following IP for the allowed access IP
Allow 10/8allow 192.168/16allow 172.16/12
Restart the Chrony service to
Two. Synchronization time of other nodes
Other nodes can be any system, class Linux systems can be installed Chrony,ntpd,windows system directly configuration can be
1. Using the Chrony tool, install ditto, modify the configuration file, only need to modify the "server" item to the above time server can
Server 10.168.10.10
2. Using NTPD
Installation in the CentOS system
Yum Install NTP
Modify the configuration file, add "server 10.168.10.10" to the following configuration file
Vi/etc/ntp.conf
3. Windows system, modify the automatic synchronization of the time server
Related information:
1. http://docs.openstack.org/liberty/install-guide-ubuntu/environment-ntp.html
2. http://www.chrony.tuxfamily.org/
3. HTTP://WWW.POOL.NTP.ORG/ZONE/CN
Transferred from: http://www.cnblogs.com/wzy5223/p/5345378.html
====================================
To view synchronization:
Common commands Chronyc sources-v view synchronization sources
[Email protected] ~]# chronyc sources-v
Sources = 1
.--Source mode ' ^ ' = server, ' = ' = Peer, ' # ' = local clock.
/.-Source State ' * ' = current synced, ' + ' = combined, '-' = not combined,
| /'? ' = unreachable, ' x ' = time May is in error, ' ~ ' = time too variable.
|| .-xxxx [YYYY] +/-zzzz
|| reachability Register (octal)-. | xxxx = adjusted offset,
|| LOG2 (Polling interval)--. | | yyyy = measured offset,
|| \ | | zzzz = Estimated error.
|| | | \
MS NAME/IP address stratum Poll Reach Lastrx Last sample
===============================================================================
^? Controller0 0 7 0 10y +0ns[+0ns] +/-0ns
[Email protected] ~]# chronyc sources-v
Sources = 1
.--Source mode ' ^ ' = server, ' = ' = Peer, ' # ' = local clock.
/.-Source State ' * ' = current synced, ' + ' = combined, '-' = not combined,
| /'? ' = unreachable, ' x ' = time May is in error, ' ~ ' = time too variable.
|| .-xxxx [YYYY] +/-zzzz
|| reachability Register (octal)-. | xxxx = adjusted offset,
|| LOG2 (Polling interval)--. | | yyyy = measured offset,
|| \ | | zzzz = Estimated error.
|| | | \
MS NAME/IP address stratum Poll Reach Lastrx Last sample
===============================================================================
^? Controller0 0 7 0 10y +0ns[+0ns] +/-0ns
Common commands:
Timedatectl status
Timedatectl SET-NTP true/false//Set up remote sync NTP server
[Turn + original]chrony