[root@localhost ~]# cat /etc/redhat-release CentOS release 6.8 (Final) [root@localhost ~]# rpm -qa |grep ntp ntp-4.2.6p5-15.el6.centos.x86_64 fontpackages-filesystem-1.41-1.1.el6.noarch ntpdate-4.2.6p5-15.el6.centos.x86_64 如果没安装,请输入命令安装
cat /etc/ntp.conf #修改配置文件如下图
加入开机自启动 chkconfig --list ntpd chkconfig ntpd on chkconfig --list ntpd
重启服务并查看服务状态 /etc/init.d/ntpd status /etc/init.d/ntpd restart /etc/init.d/ntpd status
查询监听端口协议 netstat -lnptu|grep ntp Ntpstat
查看同步服务使用状态 ntpq -p
查看防火墙状态 service iptables status 如果防火墙未关闭,请直接关闭防火墙和selinux 如果需要开启防火墙,请放行ntp服务端口 查看日志 cat /var/log/messages
---------------------------------------------交换机同步ntp -------------------------------------------- ntp服务器IP: 172.30.241.176 交换机上同步命令 ntp-service unicast-server 172.30.241.176 preference 前提 交换机要能ping通服务器IP 注意: ----------------------------------------------windows同步ntp ------------------------------------------ ntp服务器IP: 172.30.241.176 控制面板>时钟和区域>设置时间和日期
|
|
来自: python_lover > 《待分类》