centos6 使用RAC其中一个节点作为同步服务器
环境:
OS:Centos6.9
我们约定rac的节点1作为ntp服务器,节点2作为ntp客户端
---------------节点1上的安装配置(ntp服务器)-------------
1.安装ntp ntpdate
yum install ntp ntpdate -y
2.启动ntp服务
[root@rac01 ~]# service ntpd start
[root@rac01 ~]# service ntpd status
3.修改配置文件,使该NTP服务器在不联网的情况下,使用本服务器的时间作为同步时间
vi /etc/ntp.conf
把如下四行代码注释掉
#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
fudge 127.127.1.0 stratum 0
4.重启动ntp
[root@rac01 ~]# service ntpd restart
[root@rac01 ~]# service ntpd status
5.查看是否同步
[root@rac01 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 0 l 24 64 7 0.000 0.000 0.000
6.开机自启动
[root@cluster01 ~]# chkconfig ntpd on
[root@cluster01 ~]# chkconfig ntpdate on
[root@cluster01 ~]# chkconfig --list |grep ntpd
[root@rac01 /]# chkconfig --list |grep ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpdate 0:off 1:off 2:on 3:on 4:on 5:on 6:off
7.设置防火墙,打开udp123端口(如果防火墙关了就不用设置了)
[root@hadoop101 ~]# firewall-cmd --permanent --add-port=123/udp
-------------节点2上的安装配置(ntp客户端)-------------
1.安装ntp ntpdate
yum install ntp ntpdate -y
2.启动ntp服务
[root@rac01 ~]# service ntpd start
[root@rac01 ~]# service ntpd status
3.修改配置文件
vi /etc/ntp.conf
#注释掉其他上游时间服务器
#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.58.111
Fudge 192.168.58.111 stratum 0
#配置允许上游时间服务器主动修改本机的时间
restrict 192.168.58.111 nomodify notrap noquery
4.重启动ntp
[root@rac02 u01]# service ntpd restart
5.与本地ntpd Server同步一下
[root@rac02 u01]# ntpdate -u 192.168.58.101
6.设置开机自启动
[root@cluster01 ~]# chkconfig ntpd on
[root@cluster01 ~]# chkconfig ntpdate on
7.查看状态
[root@rac02 u01]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*rac01 .LOCL. 1 u 33 64 177 0.185 59.486 24.128
8.或是在crontab中定时同步节点1上的时间
@hourly /usr/sbin/ntpdate -u 192.168.58.101 >/dev/null 2>&1
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2021-08-31 Centos 7开机自启动oracle
2020-08-31 主从数据不一致导出同步错误pt-slave-restart(主库删除记录,从库不存在)