国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

centos7安裝chronyd服務方式

瀏覽:59日期:2023-10-01 20:59:26
目錄centos7安裝chronyd服務Centos7使用chronyd進行時鐘同步安裝配置文件啟動服務及時區設置驗證服務手動同步時間手動設置時間總結centos7安裝chronyd服務

一、雙節點部署:

ip主機名192.168.100.10controller192.168.100.20compute

二、配置時間同步

1、雙節點安裝chrony服務(這里是使用本地的軟件包進行yum安裝)

[root@controller ~]# yum install -y chrony[root@compute ~]# yum install -y chrony

2、controller修改chrony服務配置文件(在/etc/chrony.conf目錄下)

[root@controller ~]# vi /etc/chrony.conf # Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).#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 //添加#號server controller iburst //添加這一行# Record the rate at which the system clock gains/losses time.driftfile /var/lib/chrony/drift# Allow the system clock to be stepped in the first three updates# if its offset is larger than 1 second.makestep 1.0 3# Enable kernel synchronization of the real-time clock (RTC).rtcsync# Enable hardware timestamping on all interfaces that support it.#hwtimestamp *# Increase the minimum number of selectable sources required to adjust# the system clock.#minsources 2# Allow NTP client access from local network.allow all //去掉#號# Serve time even if not synchronized to a time source.local stratum 10 //去掉#號# Specify file containing keys for NTP authentication.#keyfile /etc/chrony.keys# Specify directory for log files.logdir /var/log/chrony# Select which information is logged.#log measurements statistics tracking

3、compute 修改chrony配置文件

[root@compute ~]# vi /etc/chrony.conf # Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).#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 iburstserver 192.168.100.10 iburst //添加這一行# Record the rate at which the system clock gains/losses time.driftfile /var/lib/chrony/drift# Allow the system clock to be stepped in the first three updates# if its offset is larger than 1 second.makestep 1.0 3# Enable kernel synchronization of the real-time clock (RTC).rtcsync# Enable hardware timestamping on all interfaces that support it.#hwtimestamp *# Increase the minimum number of selectable sources required to adjust# the system clock.#minsources 2# Allow NTP client access from local network.#allow 192.168.0.0/16# Serve time even if not synchronized to a time source.#local stratum 10# Specify file containing keys for NTP authentication.#keyfile /etc/chrony.keys# Specify directory for log files.logdir /var/log/chrony# Select which information is logged.#log measurements statistics tracking

4、雙節點重啟服務,并設置開機自啟

[root@controller ~]# systemctl restart chronyd && systemctl enable chronyd[root@compute ~]# systemctl restart chronyd && systemctl enable chronyd

5、controller開啟ntp同步

[root@controller ~]# timedatectl set-ntp true

6、雙節點執行chronyc sources命令,結果中存在以^*開頭的行,則同步成功

[root@controller ~]# chronyc sources210 Number of sources = 1MS Name/IP address Stratum Poll Reach LastRx Last sample ===============================================================================^* controller 10 6 377 27 +186ns[-8404ns] +/- 17us[root@compute ~]# chronyc sources210 Number of sources = 1MS Name/IP address Stratum Poll Reach LastRx Last sample ===============================================================================^* controller 10 6 17 34 -4280ns[ -13us] +/- 328usCentos7使用chronyd進行時鐘同步

最近要做阿里云遷移 IDC 機房,整理下 Linux 運維基線,簡單記錄,以備后用~

安裝# 默認已經安裝$ yum install -y chrony配置文件$ cat /etc/chrony.conf# Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).# 國家服務器server 0.cn.pool.ntp.orgserver 1.cn.pool.ntp.orgserver 2.cn.pool.ntp.orgserver 3.cn.pool.ntp.org# 阿里server ntp.aliyun.com# 騰訊server time1.cloud.tencent.comserver time2.cloud.tencent.comserver time3.cloud.tencent.comserver time4.cloud.tencent.comserver time5.cloud.tencent.com# 蘋果server time.asia.apple.com# 微軟server time.windows.com# 其他server cn.ntp.org.cn# Record the rate at which the system clock gains/losses time.driftfile /var/lib/chrony/drift# Allow the system clock to be stepped in the first three updates# if its offset is larger than 1 second.makestep 1.0 3# Enable kernel synchronization of the real-time clock (RTC).rtcsync# Enable hardware timestamping on all interfaces that support it.#hwtimestamp *# Increase the minimum number of selectable sources required to adjust# the system clock.#minsources 2# Allow NTP client access from local network.#allow 192.168.0.0/16# Serve time even if not synchronized to a time source.#local stratum 10# Specify file containing keys for NTP authentication.#keyfile /etc/chrony.keys# Specify directory for log files.logdir /var/log/chrony# Select which information is logged.#log measurements statistics tracking啟動服務及時區設置# 啟動服務$ systemctl start chronyd# 開機啟動$ systemctl enable chronyd# 查看當前狀態$ systemctl status chronyd# 查看亞洲時區$ timedatectl list-timezones | grep Asia# 設置時區$ timedatectl set-timezone Asia/Shanghai驗證服務# 查看現有的時間服務器$ chronyc sources -v# 查看時間服務器狀態$ chronyc sourcestats -v# 顯示時鐘同步相關參數$ chronyc tracking# 查看當前時區及時間$ timedatectl?手動同步時間# 使用 ntpdate 同步時間$ ntpdate ntp.aliyun.com# chronyd 未啟動時,如下命令同步時間$ chronyd -q 'server pool.ntp.org iburst'# chronyd 啟動時,使用如下命令同步時間$ chronyc -a 'burst 4/4' && sleep 10 && chronyc -a makestep手動設置時間# date 設置時間$ date -s '2021-06-03 19:00:00'# 關閉 ntp 同步后,才可以使用 timedatectl 進行時間設置$ timedatectl set-ntp false# 設置日期和時間$ timedatectl set-time '2021-06-03 19:00:00'# 設置日期$ timedatectl set-time '2021-06-03'# 設置時間$ timedatectl set-time '19:00:00'# 設置完成后,再開啟$ timedatectl set-ntp true總結

以上為個人經驗,希望能給大家一個參考,也希望大家多多支持好吧啦網。

標簽: Linux
主站蜘蛛池模板: 欧美另类孕交 | 一级淫片免费视频 | 成人免费福利片在线观看 | 久久久精品久久久久久久久久久 | 男女交性拍拍拍高清视频 | 国产一区二区三区手机在线观看 | 日本高清在线中文字幕网 | 伊人国产在线视频 | 末满18以下勿进色禁网站 | 国产精品成aⅴ人片在线观看 | 2021国内自拍 | 亚洲视频在线免费看 | www.成年人 | 波多野结衣视频免费在线观看 | 亚洲国产亚洲片在线观看播放 | 韩国一级a毛片 | 久青草视频在线 | 久久精品福利视频在线观看 | 91精品自在拍精选久久 | 精品国产v | 欧美成人免费观看 | 亚洲精品国产一区二区图片欧美 | 久久精品成人国产午夜 | 亚洲欧美一区二区三区在线 | 久99久精品视频免费观看v | 久久成人18免费网站 | 亚洲高清一区二区三区久久 | 欧美精品videosbestsex另类 | 中文乱码字幕午夜无线观看 | 国产精品爱久久久久久久 | 国产视频一区二区三区四区 | 久久88香港三级台湾三级中文 | 欧美极品第1页专区 | 亚洲黄色软件 | 在线观看国产情趣免费视频 | 欧美成人a| 久色tv| 91av小视频 | 欧美三级网 | 欧美精品99久久久久久人 | 一级一片免费视频播放 |