centos7集群部署本地时钟源

- 安装ntp服务

yum -y install ntp

- tzselect选择时区

tzselect

在这里插入图片描述
- vi 环境变量

1. vi /etc/profile
2. 把 TZ='Asia/Shanghai'; export TZ  写入到/etc/profile文件中
  • vi /etc/ntp.conf文件

添加以下内容:
在这里插入图片描述
- 重启ntp服务

systemctl restart ntpd

- 使用时间同步协议ntp slave同步master时间
在slave从节点上使用# ntpdate 主机IP同步主节点时间
:可以使用定时任务同步时间

猜你喜欢

转载自blog.csdn.net/weixin_46376562/article/details/106903578