虚拟机时间同步

Linux 时间同步 

所有节点安装 NTP:
 yum install ntp
配置开机启动:
 chkconfig ntpd on
检查是否设置成功:
 chkconfig --list ntpd (2-5 为 on 状态则成功)
设置同步:
 ntpdate -u ntp.sjtu.edu.cn(时钟服务器根据实际环境设置、本文采用 210.72.145.44-国家授时中心服务器 IP 地址)

1. ntpdate -u ntp.sjtu.edu.cn

执行标志: 1 Dec 04:30:04 ntpdate[30679]: adjust time server 193.182.111.14 offset 0.287204 sec

2. cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

执行信息: cp: overwrite `/etc/localtime'?   选择 y

3. ntpdate pool.ntp.org

执行标志: 1 Dec 20:33:42 ntpdate[30695]: adjust time server 193.182.111.14 offset 0.171588 sec

4.  date

查看时间是否已经同步。

猜你喜欢

转载自www.cnblogs.com/lvlin241/p/11967572.html