Hadoop 同步集群时间ntp

本文介绍了root用户进行NTP时间校准服务器配置及客户端校准的操作。包括查看机器是否安装ntp、修改配置文件、查看和开启ntpd服务等步骤完成服务器配置,客户端可设置定时任务或直接校准,每隔10分钟校准一次。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

root 用户操作

1,rpm -qa|grep ntp 查看机器是否安装ntp

2,vi /etc/ntp.conf

  修改:

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.178.0 mask 255.255.255.0 nomodify notrap      

192.168.178.0  代表网段

 

 注释:

#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

新增:

server 127.127.1.0# local clock

fudge 127.127.1.0 stratum 10

保存,退出

3,vi /etc/sysconfig/ntpd

新增:

SYNC_HWCLOCK=yes

4,查看ntpd 服务

service status ntpd , 有可能会提醒用systemctl 命令

systemctl status ntpd

开启

systemctl start ntpd, systemctl enable ntpd(重启生效,保存到状态文件)

systemctl stop ntpd,systemctl disable ntpd(重启生效,保存到状态文件)

至此,时间校准的服务器配好

5,其他客户端,需要校准服务器

设置定时任务:crontab -e

0-59/10 * * * * /usr/sbin/ntpdate hella-hadoop.chris.com

hella-hadoop.chris.com 是服务器

每隔10 分钟会校准一次

也可以/usr/sbin/ntpdate hella-hadoop.chris.com直接校准

 

转载于:https://www.cnblogs.com/pickKnow/p/10822483.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值