免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1091 | 回复: 0
打印 上一主题 下一主题

EsxServer 的时间同步设置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-14 19:53 |只看该作者 |倒序浏览

Abner Kou原创,转载请注明出处http://abner.cublog.cn
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.5(192.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.
显示客户端的查询服务被阻止

5:esxcfg-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进程运行状态


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/37091/showart_1900225.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP