欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

Linux之服务器时间同步

发布时间:2025/3/19 37 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Linux之服务器时间同步 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

Linux时间同步(把nameNode1作为时间同步服务器)

设置时区

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

联网情况:ntpdate us.pool.ntp.org

查看NTP状态

service ntpd status

yum install ntpd

chkconfig ntpd on

配置ntp服务端:

vim /etc/ntp.conf

restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap

server 127.127.1.0 # local clock

fudge 127.127.1.0 stratum 10

保存退出

service ntpd restart

客户端:

注掉与Internet通信的Server,使用本地时钟

server 192.168.0.101

在所有子节点上执行命令手动同步时间

ntpdate 192.168.0.101

service ntpd restart

转载于:https://www.cnblogs.com/chaoren399/p/4749283.html

总结

以上是生活随笔为你收集整理的Linux之服务器时间同步的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。