MySQL主从复制[001]之 NTP

NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各个计算机的时间的协议。

以下是Centos7中主从的安装配置操作过程

安装ntp

# yum install ntp -y

启动服务

# systemctl start ntpd.service

查看启动状态

# systemctl status ntpd.service

开机自启

# systemctl enable ntpd.service

配置文件

# vim /etc/ntp.conf

以下是配置文件中需要修改的内容

– master –

# the administrative functions.
restrict 192.168.11.125 nomodify notrap nopeer noquery

# Hosts on local network are less restricted.
restrict 192.168.11.0 mask 255.255.255.0 nomodify notrap

# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 127.127.1.0
Fudge 127.127.1.0 stratum 10
#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

– slave –

# the administrative functions.
restrict 192.168.11.126 nomodify notrap nopeer noquery

# Hosts on local network are less restricted.
restrict 192.168.11.0 mask 255.255.255.0 nomodify notrap

# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 192.168.11.125
Fudge 192.168.11.125 stratum 10
#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

查看主从状态

$ ntpq -p

– master –

remote     refid    st t  when poll reach  delay   offset  jitter
=================================================================
*LOCAL(0)  .LOCL.   5  l   18   64    7    0.000    0.000   0.000

– slave –

     remote      refid      st t when poll reach   delay  offset   jitter
========================================================================
 192.168.11.125  LOCAL(0)   6  u  37   64    1     0.758  -281.00  0.000
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值