linux ntp時間同步

2021-08-20 23:13:44 字數 1156 閱讀 2666

2上傳tar包到伺服器,解壓編譯

[root@server tools]# tar -zxf ntp-4.2.8p11.tar.gz

[root@server tools]# cd ntp-4.2.8p11

[root@server ntp-4.2.8p11]# ./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks

[root@server ntp-4.2.8p11]# make && make install

3修改配置檔案ntp.conf

在「restrict default nomodify notrap noquery(表示預設拒絕所有ip的時間同步)」之後增加一行:

restrict 192.168.1.0 mask 255.255.255.0 nomodify

5.在client節點上設定ntp伺服器為server節點 

6.在client節點上同步server的時間 

ntpdate 10.107.18.35

7.client節點啟動ntpd服務

systemctl start ntpd

systemctl enable ntpd

測試是否同步 

[root@cobbler ~]# ntpdate 172.16.1.62

10 jan 09:07:47 ntpdate[1504]: adjust time server 172.16.1.62 offset -0.001513 sec

定時任務

文章參考:

linux ntp 時間同步

一 外網同步時間 1.檢視ntpd服務狀態 root cdh sbin service ntpd status ntp unrecognized service 說明 ntpd沒有安裝。2.檢視是否存在ntp的yum源 root cdh sbin yum list grep ntp 3.如果有顯示出...

linux ntp時間同步

ntpdate 1.cn.pool.ntp.org url linux下ntpdate時間同步 ntp伺服器安裝配置 rpm ivh ntp 4.2.0.a.20040617 4.x86 64.rpm 或 yum y install ntp.x86 64 時間同步方法 同步命令 ntpdate nt...

linux ntp 時間同步

一.時間同步伺服器 可以將資料庫伺服器作為同步伺服器 ntp.conf 保持不變 啟動服務 service ntpd start 設定ntpd服務自啟動 chkconfig ntpd on 檢查 chkconfig list ntpd 二.客戶端配置 1.修改ntp.conf的server配置項。注...