久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

NTP服務器怎么配置和部署

142次閱讀
沒有評論

共計 1052 個字符,預計需要花費 3 分鐘才能閱讀完成。

NTP服務器 配置和部署的方法:1、使用 cp 命令備份 ntp 服務器配置文件;2、使用 egrep 命令優化配置文件;3、使用 vim 命令編輯配置文件,包括配置文件文本、允許內網其他機器同步時間、定義使用的上游 ntp 服務器和定義服務器時間;4、啟動 NTP 服務器;5、測試服務器與客戶端時間是否同步。

具體操作如下:

1、備份 ntp 服務器配置文件

cp /etc/ntp.conf /etc/ntp.conf.bak

ll /etc/ntp.conf*

2、精簡優化配置文件

egrep -v "^$|#" /etc/ntp.conf.bak >/etc/ntp.conf

3、編輯配置文件

vim /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

允許內網其他機器同步時間

restrict 172.16.1.0 mask 255.255.255.0 nomodify notr

#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

定義使用的上游 ntp 服務器,將原來的注釋

server ntp1.aliyun.com

server time1.aliyun.com

允許上層時間服務器主動修改本機時間

restrict time1.aliyun.com nomodify notrap noquery

restrict ntp1.aliyun.com nomodify notrap noquery

外部時間服務器不可用時,以本地時間作為時間服務

server 127.127.1.0 

fudge 127.127.1.0 stratum 10

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

4、啟動 NTP 服務器

Centos6: /etc/init.d/ntpd start centos7: systemctl start ntpd

ntpq -p 顯示節點列表

5、客戶端時間同步測試

ntpdate 10.0.0.111(ntp 服務器)

丸趣 TV 網 – 提供最優質的資源集合!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-12-08發表,共計1052字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 水城县| 彝良县| 巩留县| 正阳县| 莱阳市| 江口县| 祁门县| 台南市| 恩施市| 东城区| 方城县| 车险| 平阴县| 崇左市| 龙门县| 兴义市| 龙州县| 夹江县| 蓝田县| 象州县| 漳平市| 沁阳市| 石狮市| 伊春市| 兴仁县| 舒城县| 祁连县| 高安市| 拜泉县| 西安市| 桂阳县| 都兰县| 荔波县| 廊坊市| 离岛区| 东台市| 察雅县| 南靖县| 英山县| 蓬安县| 龙岩市|