CDH集群离线搭建(适用内网)——NTP时钟同步配置②

10.安装NTP时钟同步

#查看chrony服务是否存在

systemctl status chrony
systemctl stop chronyd
systemctl disable chronyd

使用ntp服务

1. ntp服务端配置

1.1 安装启动ntp服务

date # 查看系统时间

## 安装
yum -y install net-tools # netstat
yum -y install ntp 
systemctl start ntpd
systemctl status ntpd
systemctl enable ntpd

1.2 修改/etc/ntp.conf

vim /etc/ntp.conf

#注释配置
#server o.rhel.pool.ntp.org.iburst
#server 1.rhel.pool.ntp.org.iburst
#server 2.rhel.pool.ntp.org.iburst
#server 3.rhel.pool.ntp.org.iburst

#在已经注释下的配置增加一些配置
server 127.127.1.0
fudge 127.127.1.0 stratum 10

1.3 修改/etc/sysconfig/ntpd文件

vim /etc/sysconfig/ntpd

#添加内容如下,用于保证硬件时间与系统时间一致
SYNC_HWCLOCK=yes

1.4 重启ntp

systemctl restart ntpd	

#查看NTP状态

ntpstat

#列出上层NTP服务器的连接状态

ntpq -p

2. ntp客户端配置

2.1. 安装,同步时间

yum -y install ntp
#同步时间ntpdate 服务端ip
ntpdate 172.21.32.198

2.2 修改/etc/ntp.conf文件

vim /etc/ntp.conf

#注释配置
#server o.rhel.pool.ntp.org.iburst
#server 1.rhel.pool.ntp.org.iburst
#server 2.rhel.pool.ntp.org.iburst
#server 3.rhel.pool.ntp.org.iburst

#在已经注释下的配置增加一些配置
#授权192.168.1.0-192.168.1.255网段上的所有机器可以从这台机器上查询和同步时间
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 172.21.30.0 mask 255.255.255.0 nomodify notrap
server 服务端ip
#server 127.127.1.0

2.3 重启ntp

systemctl restart ntpd
systemctl status ntpd

在这里插入图片描述
上一篇
CDH集群离线搭建(适用内网)——linux系统环境配置①

下一篇:
CDH集群离线搭建(适用内网)——jdk离线安装③

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值