linux上配置时间服务器
yum install ntp -y # 安装ntp时间服务器
sed -i 's/server 0.centos.pool.ntp.org iburst/server ntp1.aliyun.com iburst/' /etc/ntp.conf # 使用aliyun NTP服务
sed -i '/1.centos.pool.ntp.org/s/^/#/' /etc/ntp.conf
sed -i '/2.centos.pool.ntp.org/s/^/#/' /etc/ntp.conf
sed -i '/3.centos.pool.ntp.org/s/^/#/' /etc/ntp.conf
systemctl start ntpd && systemctl enable ntpd # 启动ntp时间服务并设置开机启动
ntp常用服务器

本文介绍了如何在Linux上配置时间服务器,确保在集群环境中slave与master节点的时间保持一致。通过设置ntp服务,不仅可以同步系统时间,还可以同步硬件时间。在/etc/sysconfig/ntpd文件中启用SYNC_HWCLOCK选项,实现硬件时间与系统时间的同步。
最低0.47元/天 解锁文章
1907

被折叠的 条评论
为什么被折叠?



