EsxServer 的时间同步设置

简介:
EsxServer  的时间同步设置

 
我的服务器出现了这样的情况,EsxServer 启动的时候,长时间停止在时间同步的位置,最后显示失败“ntpd Synchronizing with time server    [FAILED]

本文解决了此问题,并可以作为配置ESx时间同步的参考

主要是设置ntp同步的服务器地址,在防火墙上允许ntpClient通过

如果想让此台Esxserver成为NTP的服务器,可以将firewall服务停掉

 
配置过程

 
1# service ntpd restart 重启服务

Shutting down ntpd:                                        [  OK  ]

ntpd: Synchronizing with time server: tail /var/                   [FAILED]

Starting ntpd:                                              [  OK  ]

显示同步失败

 
2# tail /var/log/messages 查看日志

Apr 14 10:39:41 VmServer07 ntpd: ntpd shutdown succeeded

Apr 14 10:39:41 VmServer07 ntpdate[3402]: can't find host server

Apr 14 10:39:50 VmServer07 ntpdate[3402]: no server suitable for synchronization             found

Apr 14 10:39:50 VmServer07 ntpd:  failed

显示没有合适的同步服务器

 
3# vi /etc/ntp.conf  查看ntp服务配置文件

restrict kod nomodify notrap noquery nopeer

restrict 127.0.0.1

server 127.127.1.0

driftfile /var/lib/ntp/drift

# Authentication delay.  If you use, or plan to use someday, the

修改server地址为192.168.40.5192.168.40.5为可用的ntp服务器地址)

 
4# vi/etc/ntp/step-tickers 修改server地址为192.168.40.5

Server 192.168.40.5

如果想让次Esxserver做为NTP服务器可以在此添加网络上的NTPServer地址,比如教育网可以添加成

server s2a.time.edu.cn

server s2b.time.edu.cn

server s2c.time.edu.cn

server s2d.time.edu.cn

server s2e.time.edu.cn

 
4# esxcfg-firewall –q ntpClient

Service ntpClient is blocked.

显示客户端的查询服务被阻止

 
5esxcfg-firewall  --enableService ntpClient

开启ntp的客户端查询服务,Esx做为客户端就可以和192.168.40.5进行时间同步了。

 

6:所有设定完成,检验一下可否域时间服务器192.168.40.5同步时间

# service ntpd restart

Shutting down ntpd:                                        [  OK  ]

ntpd: Synchronizing with time server:                          [  OK  ]

Starting ntpd:                                             [  OK  ]

# ntpdate –u 192.168.40.5 手动同步时间

14 Apr 16:56:11 ntpdate[3092]: adjust time server 192.168.40.5 offset -0.006880 sec

 
7:# chkconfig  --level 345 ntpd on  设置ntpd服务自动启动

 

8:# watch  “ntpq -p”  可以查询ntpd进程运行状态



本文转自 abner110 51CTO博客,原文链接:http://blog.51cto.com/abner/149701,如需转载请自行联系原作者
目录
相关文章
|
4月前
|
Linux
配置时间同步服务
在Redhat 9.2上,Chrony被用来同步系统时间与NTP服务器。默认情况下,它已在RHEL7/CentOS7中预装。要安装,首先通过`yum -y remove chrony`卸载,然后用`yum -y install chrony`进行安装。安装后,使用`systemctl restart chronyd`重启服务,并用`systemctl enable chronyd`设置开机启动。编辑`/etc/chrony.conf`添加阿里云NTP服务器如`ntp1.aliyun.com`和`ntp2.aliyun.com`以同步时间。使用`chronyc sources -n`确认时间源。
320 4
|
12月前
NTP服务器时间配置
NTP服务器时间配置
201 0