[ESX] -
SSH 登陆到服务器service console 后,切换到 root 用户,
[root@blade13 root]# esxcfg-firewall --enableService ntpClient # 在防火墙上设置允许
# 这一步只有 ESX 3.0 以上版本才需要
[root@blade13 root]# cp /etc/ntp.conf /etc/ntp.conf.bk # 备份 ntp.conf 文件
[root@blade13 root]# vi /etc/ntp.conf
server 172.32.226.1 # 在文件的末尾添加时间服务器,可以是 IP,
server server2.examplentp.org # 也可以是 DNS 名称形式,如果写为 DNS 名称形式,
server server3.examplentp.org # 最好手工添加到 host 文件中
[root@blade13 root]# cp /etc/ntp/step-tickers /etc/ntp/step-tickers.bk # 备份 step-tickers 文件
[root@blade13 root]# vi /etc/ntp/step-tickers
172.32.226.1 # 添加 NTP server,每行一个。可以是 IP 形式
server2.examplentp.org # 也可以是 DNS 名称形式
server3.examplentp.org
[root@blade13 root]# service ntpd restart # 重启 ntpd 服务
Shutting down ntpd: [FAILED]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]
[root@blade13 root]# chkconfig --level 345 ntpd on # 设置每次开机自动启动 ntpd
[root@blade13 root]# hwclock --systohc # 设置主板 BIOS 时间和当前 ntp 时间同步
[root@blade13 root]# date # 查看当前时间
Wed Mar 26 14:13:36 CST 2008

