您的位置:首页 > 运维架构 > Linux

centos6.4配置hadoop2.2集群时间同步

2014-04-11 11:18 459 查看
首先,停止ntpd服务

sudo /etc/init.d/ntpd stop


出现

Shutting down ntpd:                                        [  OK  ]


设置时间同步

sudo ntpdate 133.100.11.8


出现

11 Apr 10:43:29 ntpdate[2252]: step time server 133.100.11.8 offset -28760.388568 sec


配置ntp同步站点

sudo vim /etc/ntp.conf


写入

server 133.100.11.8 prefer


重启ntp服务

sudo /etc/init.d/ntpd start


出现

Starting ntpd:                                             [  OK  ]


查看时间

date


验证时间是否同步

附:配置DNS域名解析

route -n 查看路由表
route add default gw 202.117.16.1 添加路由规则

vim /etc/sysconfig/network-scripts/ifcfg-eth0


DNS1=202.117.0.20
DNS2=202.117.0.21


sudo service network restart


注:在ntp server上重新启动ntp服务后,ntp server自身或者与其server的同步的需要一个时间段,这个过程可能是5分钟,在这个时间之内在客户端运行ntpdate命令时会产生no server suitable for synchronization found的错误。

在ntp server上使用命令:

watch ntpq -p


注意LOCAL的这个就是与自身同步的ntp server。

注意reach这个值,在启动ntp server服务后,这个值就从0开始不断增加,当增加到17的时候,从0到17是5次的变更,每一次是poll的值的秒数,是64秒*5=320秒的时间。

具体查看http://www.blogjava.net/spray/archive/2008/07/10/213964.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: