欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Linux下的NTP配置

這篇文章主要講解了“Linux下的NTP配置”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“Linux下的NTP配置”吧!

成都創(chuàng)新互聯(lián)公司專注于企業(yè)網(wǎng)絡(luò)營(yíng)銷推廣、網(wǎng)站重做改版、湘潭縣網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5高端網(wǎng)站建設(shè)電子商務(wù)商城網(wǎng)站建設(shè)、集團(tuán)公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為湘潭縣等各大城市提供網(wǎng)站開(kāi)發(fā)制作服務(wù)。



安裝環(huán)境:
Red Hat Enterprise Linux Server release 6.7 (Santiago)

一、檢查服務(wù)端、客戶端的ntp包是否已經(jīng)安裝,默認(rèn)是安裝的:
rpm -qa | grep ntp
rpm -q ntp

二、服務(wù)端
1.編輯ntp服務(wù)器的配置文件/etc/ntp.conf:
server 127.127.1.0               #把本機(jī)作為ntp服務(wù)端
fudge 127.127.1.0 stratum 0      #這行是時(shí)間服務(wù)器的層次。設(shè)為0則為頂級(jí),如果要向別的NTP服務(wù)器更新時(shí)間,請(qǐng)不要把它設(shè)為0
  
2.重啟ntp服務(wù):
service ntp restart(Ubuntu)

service ntpd restart(CentOS、linux)

systemctl restart ntpd(CentOS7.X、redhat linux 7以上)

3.ntp服務(wù)器的防火墻放行ntp的123端口:(如果iptable防火墻關(guān)閉則不必要做,跳過(guò)即可)
/sbin/iptables -I INPUT -p udp --dport 123 -j ACCEPT

/etc/init.d/iptables status

netstat -tlunp | grep ntp

4.檢查ntp服務(wù)是否開(kāi)機(jī)啟動(dòng),將其設(shè)置為開(kāi)機(jī)啟動(dòng)
chkconfig --list ntpd
chkconfig --level 345 ntpd on

三、客戶端ntp client

1.編輯ntp客戶端的配置文件/etc/ntp.conf,添加server_ip:
server server_ip

2.啟動(dòng)后,一般需要5-10分鐘左右的時(shí)候才能與外部時(shí)間服務(wù)器開(kāi)始同步時(shí)間。可以通過(guò)命令查詢NTPD服務(wù)情況。
service ntpd restart

--查看狀態(tài):
ntpq -p

或者
watch "ntpq –p"

--查看ntp服務(wù)器有無(wú)和上層ntp連通:
ntpstat

--如果需要,手工同步,則需要先將client的ntp服務(wù)停掉:

servict ntpd stop
ntpdate ntpserver_ip


3.檢查ntp服務(wù)是否開(kāi)機(jī)啟動(dòng),將其設(shè)置為開(kāi)機(jī)啟動(dòng)
chkconfig --list ntpd
chkconfig --level 345 ntpd on

實(shí)例:
客戶端:
[root@one ~]#  grep -v ^# /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server 192.168.56.20 prefer
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
[root@one ~]#
[root@one ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 192.168.56.20   .LOCL.           1 u   27   64  177    0.167  2100350 8577226
[root@one ~]#
[root@one ~]#  ntpstat
synchronised to unspecified at stratum 2
   time correct to within 14779 ms
   polling server every 64 s
[root@one ~]#

服務(wù)端端server_ip端:
[root@slient ~]#  grep -v ^# /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server 127.127.1.0
fudge 127.127.1.0 stratum 0
[root@slient ~]#

感謝各位的閱讀,以上就是“Linux下的NTP配置”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)Linux下的NTP配置這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

網(wǎng)站名稱:Linux下的NTP配置
文章來(lái)源:http://chinadenli.net/article6/gspiig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站關(guān)鍵詞優(yōu)化做網(wǎng)站企業(yè)網(wǎng)站制作網(wǎng)站收錄企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營(yíng)