centos7安装ntp时间服务器

全部机器卸载chronynode

yum -y remove chrony

安装iptablescentos

sudo rpm -Uvh iptables-1.4.21-24.el7.x86_64.rpm --nodeps --force
sudo rpm -Uvh iptables-services-1.4.21-24.el7.x86_64.rpm --nodeps --force

用rpm -qa|grep iptables命令进行验证服务器

验证始终同步,在全部节点执行ntpq -p命令rest

ntpq -p

启动iptables.service,并查看规则code

systemctl start iptables.service 
iptables -L

安装ntpserver

rpm -Uvh autogen-libopts-5.18-5.el7.x86_64.rpm --nodeps --force

rpm -Uvh ntpdate-4.2.6p5-18.el7.centos.x86_64.rpm --nodeps --force

rpm -ivh ntp-4.2.6p5-18.el7.centos.x86_64.rpm --force --nodeps

修改配置文件blog

vi /etc/ntp.conf
注释server *.centos.pool.ntp.org

添加ip

server 192.168.11.60 #时间服务器IP

重启ntpd服务rem

systemctl restart ntpd

查看ntp状态同步

systemctl status  ntpd

设置开机启动

systemctl enable ntpd.service

验证始终同步,在全部节点执行ntpq -p命令

ntpq -p

[root@gfertest01 ~]# ntpq -p Temporary failure in name resolution  #--若是报这错误 修改每台机器hosts文件

相关文章
相关标签/搜索