Linux之服务器时间同步

Linux时间同步(把nameNode1作为时间同步服务器)

设置时区

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

联网情况:ntpdate us.pool.ntp.org

查看NTP状态

service ntpd status

yum install ntpd

chkconfig ntpd on

配置ntp服务端:

vim /etc/ntp.conf

restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap

server 127.127.1.0 # local clock

fudge 127.127.1.0 stratum 10

保存退出

service ntpd restart

客户端:

注掉与Internet通信的Server,使用本地时钟

server 192.168.0.101

在所有子节点上执行命令手动同步时间

ntpdate 192.168.0.101

service ntpd restart

posted @ 2015-08-21 23:16  农民阿姨  阅读(451)  评论(0编辑  收藏  举报