Linux下NTP服務(wù)器配置詳細(xì)過程
更新時(shí)間:2021年11月30日 10:05:33 作者:jks212454
大家好,本篇文章主要講的是Linux下NTP服務(wù)器配置詳細(xì)過程,感興趣的同學(xué)趕快來看一看吧,對(duì)你有幫助的話記得收藏一下哦,方便下次瀏覽
一、環(huán)境配置
1.NTP服務(wù)器
NTP服務(wù)器版本:Red Hat Enterprise Linux release 8.0 (Ootpa) NTP服務(wù)器IP:192.168.8.11/24 NTP服務(wù)器hostname:node1
2.業(yè)務(wù)服務(wù)器
NTP服務(wù)器版本:Red Hat Enterprise Linux release 8.0 (Ootpa) NTP服務(wù)器IP:192.168.8.12/24 NTP服務(wù)器hostname:node2
二、NTP服務(wù)器配置
1.查看chrony服務(wù)狀態(tài)
[root@node1 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:chronyd(8)
man:chrony.conf(5)
[root@node1 ~]#
2.啟動(dòng)chrony服務(wù)
[root@node1 ~]# systemctl enable --now chronyd Created symlink /etc/systemd/system/multi-user.target.wants/chronyd.service → /usr/lib/systemd/system/chronyd.service.
3.關(guān)閉防火墻和selinux
[root@node1 ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@node1 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@node1 ~]# setenforce 0
setenforce: SELinux is disabled
[root@node1 ~]# getenforce
Disabled
[root@node1 ~]#
4.配置NTP服務(wù)文件
[root@node1 ~]# vim /etc/chrony.conf [root@node1 ~]# cat /etc/chrony.conf |grep -Ei '(allow|local)' # Allow the system clock to be stepped in the first three updates # Allow NTP client access from local network. #allow 192.168.0.0/16 allow 192.168.8.0/24 local stratum 10 [root@node1 ~]#
5.重啟服務(wù)
[root@node1 ~]# systemctl restart chronyd [root@node1 ~]#
三、業(yè)務(wù)服務(wù)器配置
1.開啟chrony服務(wù)
[root@node2 ~]# systemctl enable --now chronyd Created symlink /etc/systemd/system/multi-user.target.wants/chronyd.service → /usr/lib/systemd/system/chronyd.service. [root@node2 ~]#
2.配置chrony服務(wù)文件
[root@node2 ~]# vim /etc/chrony.conf [root@node2 ~]# cat /etc/chrony.conf |grep pool # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). pool 192.168.8.11 iburst [root@node2 ~]#
3.重啟服務(wù)
[root@node2 ~]# systemctl restart chronyd [root@node2 ~]#
四、測(cè)試業(yè)務(wù)服務(wù)器時(shí)間狀態(tài)
1.查看時(shí)間同步狀態(tài)
[root@node2 ~]# chronyc sources 210 Number of sources = 1 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^? 192.168.8.12 0 7 0 - +0ns[ +0ns] +/- 0ns [root@node2 ~]#
2.立即時(shí)間同步
[root@node2 ~]# chronyc sources 210 Number of sources = 1 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 192.168.8.11 10 6 17 2 +249ns[ +141us] +/- 100us [root@node2 ~]# chronyc sources -v 210 Number of sources = 1 .-- Source mode '^' = server, '=' = peer, '#' = local clock. / .- Source state '*' = current synced, '+' = combined , '-' = not combined, | / '?' = unreachable, 'x' = time may be in error, '~' = time too variable. || .- xxxx [ yyyy ] +/- zzzz || Reachability register (octal) -. | xxxx = adjusted offset, || Log2(Polling interval) --. | | yyyy = measured offset, || \ | | zzzz = estimated error. || | | \ MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 192.168.8.11 10 6 17 8 +249ns[ +141us] +/- 1103us [root@node2 ~]#
到此這篇關(guān)于Linux下NTP服務(wù)器配置詳細(xì)過程的文章就介紹到這了,更多相關(guān)Linux NTP服務(wù)器配置內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
windows apache環(huán)境下部署SSL證書讓網(wǎng)站支持https的配置方法
由于網(wǎng)站劫持與chrome瀏覽器默認(rèn)不用https的提示網(wǎng)站不安全的原因,今天把SSL證書部署分享一下,希望能幫到大家2020-09-09
解析Linux高性能網(wǎng)絡(luò)IO和Reactor模型
網(wǎng)絡(luò)I/O,可以理解為網(wǎng)絡(luò)上的數(shù)據(jù)流。通常我們會(huì)基于socket與遠(yuǎn)端建立一條TCP或者UDP通道,然后進(jìn)行讀寫。單個(gè)socket時(shí),使用一個(gè)線程即可高效處理;然而如果是10K個(gè)socket連接,或者更多,我們?nèi)绾巫龅礁咝阅芴幚?/div> 2021-06-06
基于Apache?Hudi在Google云構(gòu)建數(shù)據(jù)湖平臺(tái)的思路詳解
這篇文章主要介紹了基于Apache?Hudi在Google云構(gòu)建數(shù)據(jù)湖平臺(tái),本文提供了有關(guān)如何使用上述工具構(gòu)建基本數(shù)據(jù)管道的基本介紹,需要的朋友可以參考下2022-04-04
簡(jiǎn)單了解Linux性能監(jiān)控命令free
這篇文章主要介紹了簡(jiǎn)單了解Linux性能監(jiān)控命令free,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-07-07
linux 遠(yuǎn)程控制windows系統(tǒng)下的程序(三種方法)
這篇文章主要介紹了linux 遠(yuǎn)程控制windows下的程序,本文通過三種方法給大家詳細(xì)介紹,需要的朋友可以參考下2019-10-10最新評(píng)論

