user 发表于 2024-4-10 10:24:52

CentOS中时钟服务器ntp的相关配置

本帖最后由 user 于 2024-4-10 10:26 编辑

设置时钟同步选择一台服务器作为NTP服务器 如没有ntpd服务请先yum安装:1. 编辑配置文件/etc/ntp.confvim /etc/ntp.conf去掉以下两行前面的 # 号注释(若是没有此配置,则在相应的位置添加)server 127.127.1.0fudge127.127.1.0stratum 10
2. 如果发现系统时间不准,手动修改所有服务器的系统时间为当前北京时间(可选)date -s "2023-04-14 15:11:22"
3. 启动ntpd服务:systemctl restart ntpdsystemctl enable ntpd
在非时钟服务器执行echo 'server_l'>> /etc/ntp.confsystemctl restart ntpdntpq -p
所有服务器同步配置:clush -g all0 systemctl start ntpdclush -g all0 systemctl enable ntpd检查服务器时间clush -g all date
如果出现了非CST的,需要纠正。UTC: Coordinated Universal Time-世界标准时间EST:英国时间CST:北京时间UTC/GMT +8 小时
页: [1]
查看完整版本: CentOS中时钟服务器ntp的相关配置