本地搭建hadoop集群--ntp同步集群时间
使用ntp对外提供服务器集群时间同步
一般选择masterzu作为ntp服务器
首先检查机器是否 安装ntp
rpm -qa|grep ntp
如果安装则编辑文档如下操作 保存退出
vim /etc/ntp.conf
第一个圈 取消注释
第二个圈全部注掉
第三个自己加上去
修改/etc/sysconfig/ntpd 文件
vim /etc/sysconfig/ntpd
增加内容如下,退出并保存
SYNC_HWCLOCK=yes
重新启动 ntpd
service ntpd start
chkconfig ntpd on
其他机器在root目录下创建 调度任务
crontab -e
* */1 * * * /usr/sbin/ntpdate master
指定 1小时 同步以下时间