咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
第一方法: 简单 高效 没烦恼 一条命令解决单台server-time
ntpdate -u ntp.api.bz
第二方法:时间服务器:
1) sudo yum install ntp
2)sudo nano /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap #服务器的地址
3)sudo nano /etc/ntp/step-tickers
加入一行(也可以在原有基础上改写)
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4)sudo systemctl restart ntpd
5)ss -an |grep 123
确保该端口以udp方式开放
6)sudo systemctl enable ntpdate.service (加入开机自启动)
7)date (检测时间是否靠谱)
Wed Aug 31 11:45:50 CST 2016