CentOS7的Hadoop集群配置时间同步

master
vi /etc/ntp.conf

点击查看代码
[root@master hadoop]# vim /etc/ntp.conf

...前文省略..
# Hosts on local network are less restricted.

restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
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

..前文省略..
disable monitor

server  127.127.1.0
fudge  127.127.1.0 stratum 10

[root@master hadoop]# vim /etc/sysconfig/ntpd

# Command line options for ntpd
OPTIONS="-g"
SYNC_HWCLOCK=yes

~                                                                                                                                                                         
~              
[root@master hadoop]# service ntpd restart
Redirecting to /bin/systemctl restart ntpd.service



                                ```
</details>

从机
<details>
<summary>点击查看代码</summary>

[root@clone1 ~]# cd hadoop*
[root@clone1 hadoop-3.4.0]# crontab -e
*/1 * * * * /usr/sbin/ntpdate master // 分钟

crontab: installing new crontab
您在 /var/spool/mail/root 中有新邮件

</details>
posted @   基础狗  阅读(44)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示