-
各节点安装ntp服务
yum install ntp # 如果是离线 可以自己下载ntp服务安装包安装
-
修改ntp服务配置文件
vi /etc/ntp.conf
3. 关闭各个从节点的ntpd服务
先开启各个节点的ntpd
systemctl start ntpd
然后关闭同步子节点的ntpd
systemctl stop ntpd
systemctl disable ntpd
-
各个从节点同步主节点时间
ntpdate cdh-master
-
设置每日凌晨0点同步时间
crontab -e 0 0 * * * usr/sbin/ntpd cdh-master