标签:centos NTP server iburst 时间 服务器 ntp org pool
一台虚拟机做中继,令一台虚拟机同步时间
1.先安装ntf
[root@mysqlb ~]# yum install chrony
[root@mysqlb ~]# systemctl start chronyd
[root@mysqlb ~]# systemctl enable chronyd (开机自启)
[root@mysqlb ~]# vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). 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 # Record the rate at which the system clock gains/losses time. driftfile /var/lib/chrony/drift # Allow the system clock to be stepped in the first three updates # if its offset is larger than 1 second. makestep 1.0 3 # Enable kernel synchronization of the real-time clock (RTC). rtcsync # Enable hardware timestamping on all interfaces that support it. #hwtimestamp * # Increase the minimum number of selectable sources required to adjust # the system clock. #minsources 2 # Allow NTP client access from local network. #allow 192.168.0.0/16 allow 192.168.88.0/24 在88网段 # Serve time even if not synchronized to a time source. #local stratum 10
用 chronyc sources查看
[root@mysqlb ~]# chronyc sources 210 Number of sources = 4 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^+ h199-182-204-197.ip4.unm> 2 10 377 765 +9769us[ +10ms] +/- 108ms ^* b9d1-55de.led01.ru.misak> 2 10 377 304 +6515us[+7153us] +/- 72ms ^- 195.148.70.254 2 10 375 35m +6299us[ +11ms] +/- 212ms ^+ electrode.felixc.at 3 10 153 316 -1574us[ -937us] +/- 163ms
切换另一个虚拟机
# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #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 192.168.88.101 iburst # Record the rate at which the system clock gains/losses time. driftfile /var/lib/chrony/drift # Allow the system clock to be stepped in the first three updates # if its offset is larger than 1 second. makestep 1.0 3 # Enable kernel synchronization of the real-time clock (RTC). rtcsync # Enable hardware timestamping on all interfaces that support it. #hwtimestamp * # Increase the minimum number of selectable sources required to adjust # the system clock. #minsources 2 # Allow NTP client access from local network. #allow 192.168.0.0/16
[root@slave1 ~]# chronyc sources 210 Number of sources = 1 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* localhost 3 6 377 56 -211us[ -21us] +/- 73ms
标签:centos,NTP,server,iburst,时间,服务器,ntp,org,pool 来源: https://www.cnblogs.com/MR-ws/p/11190704.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。