centos7.2_x64搭建ntp时间服务器

系统版本centos7.2_x64
1.安装ntp时间服务程序
yum -y install ntp

2.配置ntp服务
设置时间源,这里可以使用centos提供的默认时间源,其他都为默认
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

3.更改本地的时区
参考我另外一个修改时区的文档
http://blog.51cto.com/407866527/2115211

4.启动服务和设置开机启动
systemctl start ntpd.service
systemctl enable ntpd.service

5.关闭防火墙和selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
vi /etc/sysconfig/selinux
SELINUX=disabled

6.客户端同步时间
ntpdate 192.168.5.163
17 May 14:33:16 ntpdate[35815]: step time server 192.168.5.163 offset 0.667539 sec

猜你喜欢

转载自blog.51cto.com/407866527/2117483