Linux集群 NTP 时间同步

基于CentOS 7

规划

比如有2台机器

IP

主机名

说明

192.168.103.51

cdh51

本地NTP服务端

192.168.103.52

cdh52

本地NTP客户端

安装NTP服务

每台机器都安装ntp

yum -y install ntp

NTP服务端(cdh51)配置

/etc/ntp.conf配置

1driftfile /var/lib/ntp/drift 2 3restrict default nomodify notrap nopeer noquery 4 5restrict 127.0.0.1 6restrict ::1 7 8# 添加该行允许某个网段服务器从该服务同步时间 9restrict 192.168.103.0 mask 255.255.255.0 nomodify notrap 10 11# 本地NTP服务同外网NTP服务同步时间 12server 0.centos.pool.ntp.org iburst 13server 1.centos.pool.ntp.org iburst 14server 2.centos.pool.ntp.org iburst 15server 3.centos.pool.ntp.org iburst 16 17includefile /etc/ntp/crypto/pw 18 19keys /etc/ntp/keys 20 21disable monitor

执行 ntpdate 0.centos.pool.ntp.org ,手动做一次时间同步。再执行systemctl start ntpd

查看同步情况:

1# ntpq -p 2 remote refid st t when poll reach delay offset jitter 3============================================================================== 4+ntp1.ams1.nl.le 130.133.1.10 2 u 253 256 377 229.358 -2.606 10.955 5+ntp.wdc1.us.lea 130.133.1.10 2 u 459 128 150 331.680 -44.356 17.944 6*85.199.214.100 .GPS. 1 u 384 64 140 215.429 10.354 22.668

NTP服务端(cdh51)配置

/etc/ntp.conf配置

1driftfile /var/lib/ntp/drift 2 3restrict default nomodify notrap nopeer noquery 4 5restrict 127.0.0.1 6restrict ::1 7 8# 同NTP服务端cdh51同步时间 9server cdh51 iburst 10 11includefile /etc/ntp/crypto/pw 12 13keys /etc/ntp/keys 14 15disable monitor

执行 ntpdate cdh51 ,手动做一次时间同步。再执行systemctl start ntpd

查看同步情况:

1# ntpq -p 2 remote refid st t when poll reach delay offset jitter 3============================================================================== 4*cdh51 85.199.214.100 2 u 52 128 377 0.322 -3.060 0.674
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )