安装:yum install ntp
使用ntpd服务
step1:/etc/ntpd.conf 写入 server [IP_Address]
step2:chkconfig ntpd on
step3:service ntpd start
service ntpd start/stop/restart
ntpstat 检查状态
ntpq -p
运行(先获取一下东八区的时间吧):ntpdate 210.72.145.44
国家授时中心都不能7*24的跑,还是用微软的吧ntpdate time.windows.com
ntpdatentp.sjtu.edu.cn(这个还比较靠谱)
配置/etc/ntp.conf
server 0.210.72.145.44 #(中国国家授时中心服务器IP地址)
server 1.ntp.sjtu.edu.cn #(上海交通大学网络中心NTP服务器地址)
server 2.202.120.2.101 #(上海交通大学网络中心NTP服务器地址)
检查ntp端口是否被占用,占用的话就获取不到时间