·NTP伺服器配置搭建詳情,ntp伺服器配置搭建

來源:互聯網
上載者:User

·NTP伺服器配置搭建詳情,ntp伺服器配置搭建
一·NTP伺服器搭建

1)安裝NTP服務

[root@localhost ~]# yum -y install ntp[root@localhost ~]# vim /etc/ntp.conf 
restrict 172.25.0.0 mask 255.255.255.0 nomodify notrap          //添加接受的位址範圍# Use public servers from the pool.ntp.org project.# Please consider joining the pool (https://www.pool.ntp.org/join.html).#server 0.rhel.pool.ntp.org iburst#server 1.rhel.pool.ntp.org iburst#server 2.rhel.pool.ntp.org iburst#server 3.rhel.pool.ntp.org iburstserver s1a.time.edu.cn iburst                                   //中國郵電大學NTP伺服器
[root@localhost ~]# systemctl start ntpd[root@localhost ~]# systemctl enable ntpd

2)防火牆開啟連接埠,NTP預設連接埠號碼UDP123

[root@localhost ~]# firewall-cmd --add-service=ntp --permanent         //永久生效允許存取ntp服務[root@localhost ~]# firewall-cmd --reload                      //重讀防火牆

3)查看同步

[root@localhost ~]# ntpq -p     remote           refid      st t when poll reach   delay   offset  jitter==============================================================================*10.112.202.in-a 202.118.1.46     2 u    9   64    1   93.632    9.389   5.115

4)配置ntp用戶端

[root@localhost ~]# yum -y install ntpdate                     //安裝用戶端軟體[root@localhost ~]# ntpdate s1a.time.edu.cn                        //指定伺服器網域名稱[root@localhost ~]# systemctl restart ntpdate                      //重啟服務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.