时间同步搭建ntp服务器,集群自动同步时间和ntpdate命令·~!
Centos 搭建本地NTP服务器 环境准备 步骤开始 1. 查看当前系统内核 2. server端安装服务 3. 修改配置文件 4. 启动服务 5.查看服务状态 6.验证时间同步 防踩雷 环境准备 centos7两台,防火墙关闭,selinux关闭 服务器 (server): 192.168.112.153 客户机 (client): 192.168.112.154 步骤开始 1. 查看当前系统内核 确认服务端和客户端版本一致 cat / etc / redhat - release 执行效果图 2. server端安装服务 yum - y install ntp 安装完成后,查验 3. 修改配置文件 vim / etc / ntp . conf 第8行注释掉 13,14行注释掉 17行去掉注释(#)修改为本机ip 解析:允许更新的IP地址段能同步时间 21到24行注释掉 25.26行添加 解析:如果网络时间同步服务器不可以用,就以本地时间为标准向客户端提供服务 4. 启动服务 systemctl start ntpd 启动 systemctl enable ntpd 开机自启 5.查看服务状态 systemctl status ntpd ntp查验 查看是否同步 6.验证时间同步 客户端安装ntp服务 yum - y install ntp 同步时间 ntpdate - u