Resources:
Http://www.cnblogs.com/liushui-sky/p/9203657.html (Perfer should be prefer in the blog)
https://www.jianshu.com/p/80ab71d50872
Https://www.cnblogs.com/quchunhui/p/7658853.html
Https://www.cnblogs.com/kerrycode/archive/2015/08/20/4744804.html
Man-k NTP
Mans Ntp.config
NTP server address:
http://www.ntp.org.cn
Precautions:
1, firewall release 123 port
2, if the master-slave service time more than 1000 seconds is no longer synchronized, this time to manually synchronize,
CENTOS6 script (using ntp/ntpdate): 1, server-side configuration
#!/bin/bash#1、不用判断,直接安装,有的话就不会安装,没的话也就安装上了。yum -q -y ntp ntpdate &>/dev/null#2、配置ntp服务sed -i ‘s/^server/#server/g‘ /etc/ntp.confsed -i ‘s/^restrict -6/#restrict -6/g‘ /etc/ntp.confcat >> /etc/ntp.conf <<eof#start custom config#添加同步的服务器地址server cn.ntp.org.cn prefer#权限控制restrict
Above, after 5 minutes Ntpstat check whether the synchronization, such as
2. Client Configuration
和服务器一样,只不过server地址改成ntp服务器地址即可。
Centos7 script (using Chrony):
Ntp.conf
1. Configure the synchronization source
2. Configure permissions
3, configure the operating mode and encryption mode.
Linux Time Synchronization Script