日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

centos7 NTP服务器搭建

發(fā)布時(shí)間:2023/12/20 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos7 NTP服务器搭建 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

NTP服務(wù)器搭建
驗(yàn)證NTP軟件包是否安裝

[root@localhost ~]# rpm -qa ntp* ntpdate-4.2.6p5-29.el7.centos.2.x86_64 ntp-4.2.6p5-29.el7.centos.2.x86_64

安裝ntp包

[root@localhost ~]# yum -y install ntp

配置ntp配置文件
[root@localhost ~]# yum -y install ntp

# For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do notpermit the source to query or modify the service on this system. restrict default nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. restrict 192.168.17.10 nomodify notrap nopeer noquery #當(dāng)前節(jié)點(diǎn)ip地址 restrict 127.0.0.1 restrict ::1# Hosts on local network are less restricted. #restrict 192.168.17.2mask 255.255.255.0 nomodify notrap #集群所在網(wǎng)段的網(wǎng)關(guān)(Gateway),子網(wǎng)掩碼(Genmask) # 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#選擇一個(gè)主節(jié)點(diǎn) 在server部分添加一下部分, server 127.127.1.0 Fudge 127.127.1.0 stratum 10 #主節(jié)點(diǎn)以外,在server部分添加如下語(yǔ)句,將server指向主節(jié)點(diǎn)。 server 192.168.17.10 Fudge 192.168.17.10 stratum 10#broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client

啟動(dòng)ntp
systemctl start ntpd.service 或 service ntpd start 啟動(dòng)
systemctl enable ntpd.service
systemctl status ntpd.service 狀態(tài)

查看ntp服務(wù)器有無(wú)和上層ntp連通
ntpstat
查看ntp服務(wù)器與上層ntp的狀態(tài)
ntpq -p

[root@localhost ~]# ntpq -premote refid st t when poll reach delay offset jitter ============================================================================== *202.118.1.130 .PTP. 1 u 40 64 377 51.713 2.895 4.108 -sv1.ggsrv.de 192.53.103.103 2 u 32 64 177 268.687 27.531 6.991 +tock.ntp.infoma .GPS. 1 u 29 64 353 183.400 -5.123 4.492 +service0-eth4.d 193.6.222.95 2 u 41 64 167 210.721 -5.117 26.617LOCAL(0) .LOCL. 5 l 604 64 0 0.000 0.000 0.000

remote:本機(jī)和上層ntp的ip或主機(jī)名,“+”表示優(yōu)先,“*”表示次優(yōu)先

refid:參考上一層ntp主機(jī)地址

st:stratum階層

when:多少秒前曾經(jīng)同步過(guò)時(shí)間

poll:下次更新在多少秒后

reach:已經(jīng)向上層ntp服務(wù)器要求更新的次數(shù)

delay:網(wǎng)絡(luò)延遲

offset:時(shí)間補(bǔ)償

jitter:系統(tǒng)時(shí)間與bios時(shí)間差

查看ntpd進(jìn)程的狀態(tài)
【命令】watch “ntpq -p”

【終止】按 Ctrl+C 停止查看進(jìn)程。

第一列中的字符指示源的質(zhì)量。星號(hào) ( * ) 表示該源是當(dāng)前引用。

remote:列出源的 IP 地址或主機(jī)名。

when:指出從輪詢?cè)撮_(kāi)始已過(guò)去的時(shí)間(秒)。

poll:指出輪詢間隔時(shí)間。該值會(huì)根據(jù)本地時(shí)鐘的精度相應(yīng)增加。

reach:是一個(gè)八進(jìn)制數(shù)字,指出源的可存取性。值 377 表示源已應(yīng)答了前八個(gè)連續(xù)輪詢。

offset:是源時(shí)鐘與本地時(shí)鐘的時(shí)間差(毫秒)。

設(shè)置開(kāi)機(jī)啟動(dòng)

chkconfig ntpd on

總結(jié)

以上是生活随笔為你收集整理的centos7 NTP服务器搭建的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。