Cloudera Manager 集群ntp时钟同步配置

1,954 阅读1分钟

介绍Cloudera Manager 集群的ntp设置.

查看时区

[root@cdh1 ~]# timedatectl
      Local time: Fri 2019-10-11 17:24:57 CST
  Universal time: Fri 2019-10-11 09:24:57 UTC
        RTC time: Fri 2019-10-11 09:24:57
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

如果时区不对,先调整时区

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

安装ntp (所有节点)

yum install -y ntp

修改ntp配置文件(cdh1)

vim /etc/ntp.conf
# 允许内网其他机器同步时间
restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap
server 0.cn.pool.ntp.org iburst
server 1.cn.pool.ntp.org iburst
server 2.cn.pool.ntp.org iburst
server 3.cn.pool.ntp.org iburst

修改ntp配置文件(其他节点)

vim /etc/ntp.conf
# 与主节点同步时间
server cdh1

重启ntpd

xcall systemctl start ntpd
xcall systemctl enable ntpd

过5分钟左右,可以看到cdh1的同步结果

内网其他的同步结果
可以看到cdh2 的时钟同步服务器是cdh1,并且最终时间服务器是119.28.206.193.