局域网同步时钟ntp

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

搭了个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

# 外部时
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值