搭了个cdh环境,无法连接外网,时间不同步,就选了一台机器作为NTP服务器,其它节点同步到此服务器
红字改为自己的服务器端的IP
服务器端(node1)
1、yum install ntp -y 安装ntp
2、chkconfig ntpd on 开机自启动
3、vi /etc/ntp.conf
4、从上到下改动的地方有
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
restrict 192.168.21.0 mask 255.255.255.0 nomodify notrap
注释掉
# server 0.centos.pool.ntp.org iburst
# server 1.centos.pool.ntp.org iburst
# server 2.centos.pool.ntp.org iburst
# server 3.centos.pool.ntp.org iburst
# 允许上层时间服务器主动修改本机时间
restrict 0.cn.pool.ntp.org nomodify notrap noquery
restrict 1.cn.pool.ntp.org nomodify notrap noquery
restrict 2.cn.pool.ntp.org nomodify notrap noquery
restrict 3.cn.pool.ntp.org nomodify notrap noquery
# 外部时间服务器不可用时,以本地时间作为时间服务
server

在无法连接外网的CDH环境中,通过设置一台服务器作为NTP服务器,指导其他节点进行时间同步。步骤包括安装ntp、配置ntp.conf、手动同步时间、启动服务,并检查端口与网络中NTP服务器的状态。每台客户端在启动ntpd服务前,需手动同步时间。

被折叠的 条评论
为什么被折叠?



