centos8使用chrony作為NTP伺服器
導讀 | 8不在直接使用ntp,而是使用chrony作為時間同步,chrony既可以當伺服器端廣播時間,又可以作為客戶端同步時間 |
安裝
sudo dnf install chrony -y sudo yum install chrony -y
Centos8使用firewalld服務對防火牆進行管理。放行ntp服務(123/udp)
firewall-cmd --add-service=ntp --permanent && firewall-cmd --reload
作為伺服器端
配置chrony服務端
sudo vim /etc/chrony.conf
刪除配置自帶的NTP伺服器。換成國內阿里雲的NTP伺服器地址。
新增上游NTP伺服器
server time1.aliyun.com iburst server time2.aliyun.com iburst server time3.aliyun.com iburst
允許 192.168.1.0/24 內的客戶端透過這臺伺服器獲取時間
allow 192.168.1.0/24
配置無誤後,重啟chrony服務,並配置開機自啟動:
systemctl restart chronyd.service systemctl enable chronyd.service
使用ss -tlunp | grep chrony或者 lsof -i:123 檢查chrony服務使用的123/udp埠是否啟動成功
作為客戶端
同樣安裝,然後修改客戶端chrony配置檔案
sudo vim /etc/chrony.conf # Use public servers from the pool.ntp.org project. # Please consider joining the pool (). # pool 2.centos.pool.ntp.org iburst
#新增NTP伺服器
server time1.aliyun.com iburst server time2.aliyun.com iburst server time3.aliyun.com iburst
如果有自建的chrony客戶端也可以自行配置
server 192.168.1.30 iburst
重啟chrony客戶端服務,重啟chrony服務,並配置開機自啟動:
systemctl restart chronyd.service && systemctl enable chronyd.service --now
檢視同步狀態
chronyc sources -v
本文原創地址:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69955379/viewspace-2736229/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何安裝和配置 Chrony 作為 NTP 客戶端?客戶端
- Centos8中如何使用Chrony同步時間CentOS
- 為公益伸出援手,自建NTP 伺服器池伺服器
- 時間伺服器-NTP伺服器
- SpringMVC使用Jetty作為內嵌伺服器SpringMVCJetty伺服器
- CentOS7使用NTP搭建時間同步伺服器CentOS伺服器
- Linux使用ntp時間伺服器同步時間Linux伺服器
- 使用阿里雲映象站NTP服務搭建NTP伺服器(基於CentOS 7系統)阿里伺服器CentOS
- Linux伺服器配置---ntpLinux伺服器
- chrony時間同步
- centos7的時間同步機制:chrony使用CentOS
- linux-ntp 使用Linux
- Centos8 如何配置DHCP伺服器CentOS伺服器
- linux 配置ntp時間伺服器Linux伺服器
- 兩臺伺服器時間同步(NTP)伺服器
- Linux 之 NTP 服務 伺服器Linux伺服器
- Centos8伺服器安全高階篇(四 使用者認證)CentOS伺服器
- Windows下更改並使用NTPWindows
- 如何在 CentOS 中設定 NTP 伺服器CentOS伺服器
- 國內常用NTP伺服器地址及IP伺服器
- CentOS8下的Docker使用CentOSDocker
- 使用VMWare 安裝Centos8CentOS
- Linux NTP工具的基本使用Linux
- NTP時間伺服器優先順序配置伺服器
- Windows NTP 時間伺服器 資訊 登錄檔Windows伺服器
- 配置 Squid 作為 SSH 代理伺服器UI伺服器
- Linux下chrony對時設定Linux
- Centos下部署NTP時間伺服器同步環境CentOS伺服器
- 使用NTP原理進行時間同步
- Taro,作為React開發者,使用感受React
- 使用memorycache作為session共享配置Session
- 為什麼我推薦Nginx作為後端伺服器代理Nginx後端伺服器
- github作為圖床的使用方式Github圖床
- Centos8伺服器安全高階篇(五 apache status 安全)CentOS伺服器Apache
- 在Centos8上安裝和使用curlCentOS
- 在centos8使用Docker部署Django專案CentOSDockerDjango
- Centos8 安裝並使用Ansible(一)CentOS
- Centos8 安裝並使用Ansible(二)CentOS