栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

无外网集群内部做NTP时钟同步

无外网集群内部做NTP时钟同步

环境说明
NTP服务端:Rich63.cn IP:192.168.1.63
NTP客户端:Rich64.cn IP:192.168.1.64
操作系统版本:CentOS Linux release 7.5.1804 (Core)

服务端安装配置NTP

yum install ntp ntpdate -y

修改配置文件,使该NTP服务器在不联网的情况下,使用本服务器的时间作为同步时间

vim /etc/ntp.conf # 编辑配置文件,注释掉以下4行

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

server 127.127.1.0 iburst # 配置文件内添加此行

wq保存退出!

启动ntp服务

systemctl start ntpd

验证状态

systemctl status ntpd

设置开机自启动

systemctl enable ntpd

验证ntp

ntpq -p

配置客户端

安装与服务端一致,只是配置文件修改不一样

#注释掉其他上游时间服务器

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

#配置上游时间服务器为本地的ntpd Server服务器
server 192.168.1.63

#配置允许上游时间服务器主动修改本机的时间
restrict 192.168.1.63 nomodify notrap noquery

然后初次同步需要手动同步
ntpdate -u 192.168.1.63

然后设置客户端ntp服务开机自启动即可
systemctl enable ntpd

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/707784.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号