色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

centos7安裝chronyd服務(wù)方式

瀏覽:47日期:2023-10-01 20:59:26
目錄centos7安裝chronyd服務(wù)Centos7使用chronyd進(jìn)行時(shí)鐘同步安裝配置文件啟動(dòng)服務(wù)及時(shí)區(qū)設(shè)置驗(yàn)證服務(wù)手動(dòng)同步時(shí)間手動(dòng)設(shè)置時(shí)間總結(jié)centos7安裝chronyd服務(wù)

一、雙節(jié)點(diǎn)部署:

ip主機(jī)名192.168.100.10controller192.168.100.20compute

二、配置時(shí)間同步

1、雙節(jié)點(diǎn)安裝chrony服務(wù)(這里是使用本地的軟件包進(jìn)行yum安裝)

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

2、controller修改chrony服務(wù)配置文件(在/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 //添加#號(hào)#server 1.centos.pool.ntp.org iburst //添加#號(hào)#server 2.centos.pool.ntp.org iburst //添加#號(hào)#server 3.centos.pool.ntp.org iburst //添加#號(hào)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 //去掉#號(hào)# Serve time even if not synchronized to a time source.local stratum 10 //去掉#號(hào)# 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、雙節(jié)點(diǎn)重啟服務(wù),并設(shè)置開(kāi)機(jī)自啟

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

5、controller開(kāi)啟ntp同步

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

6、雙節(jié)點(diǎn)執(zhí)行chronyc sources命令,結(jié)果中存在以^*開(kāi)頭的行,則同步成功

[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進(jìn)行時(shí)鐘同步

最近要做阿里云遷移 IDC 機(jī)房,整理下 Linux 運(yùn)維基線,簡(jiǎn)單記錄,以備后用~

安裝# 默認(rèn)已經(jīng)安裝$ 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).# 國(guó)家服務(wù)器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啟動(dòng)服務(wù)及時(shí)區(qū)設(shè)置# 啟動(dòng)服務(wù)$ systemctl start chronyd# 開(kāi)機(jī)啟動(dòng)$ systemctl enable chronyd# 查看當(dāng)前狀態(tài)$ systemctl status chronyd# 查看亞洲時(shí)區(qū)$ timedatectl list-timezones | grep Asia# 設(shè)置時(shí)區(qū)$ timedatectl set-timezone Asia/Shanghai驗(yàn)證服務(wù)# 查看現(xiàn)有的時(shí)間服務(wù)器$ chronyc sources -v# 查看時(shí)間服務(wù)器狀態(tài)$ chronyc sourcestats -v# 顯示時(shí)鐘同步相關(guān)參數(shù)$ chronyc tracking# 查看當(dāng)前時(shí)區(qū)及時(shí)間$ timedatectl?手動(dòng)同步時(shí)間# 使用 ntpdate 同步時(shí)間$ ntpdate ntp.aliyun.com# chronyd 未啟動(dòng)時(shí),如下命令同步時(shí)間$ chronyd -q 'server pool.ntp.org iburst'# chronyd 啟動(dòng)時(shí),使用如下命令同步時(shí)間$ chronyc -a 'burst 4/4' && sleep 10 && chronyc -a makestep手動(dòng)設(shè)置時(shí)間# date 設(shè)置時(shí)間$ date -s '2021-06-03 19:00:00'# 關(guān)閉 ntp 同步后,才可以使用 timedatectl 進(jìn)行時(shí)間設(shè)置$ timedatectl set-ntp false# 設(shè)置日期和時(shí)間$ timedatectl set-time '2021-06-03 19:00:00'# 設(shè)置日期$ timedatectl set-time '2021-06-03'# 設(shè)置時(shí)間$ timedatectl set-time '19:00:00'# 設(shè)置完成后,再開(kāi)啟$ timedatectl set-ntp true總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Linux
主站蜘蛛池模板: 看久久久久毛片婷婷色 | 亚洲一级二级三级 | 99国产高清久久久久久网站 | 成人在线毛片 | 久草国产在线 | 精品久久久中文字幕一区 | 欧日韩美香蕉在线观看 | 国产精品亚洲一区在线播放 | 无圣光福利视频 | 国产理论视频在线观看 | 久久精品一区二区影院 | 国内精品不卡一区二区三区 | 国产一区二区三区久久 | 99精品视频在线视频免费观看 | 日本一级毛片高清免费观看视频 | 欧美jizzhd精品欧美另类 | 中文精品久久久久国产不卡 | 国产成人久久久精品毛片 | 久久成人18免费网站 | 在线观看免费精品国产 | 男人天堂男人天堂 | 亚洲综合国产一区二区三区 | 91热久久免费频精品黑人99 | 综合免费视频 | 久久精品男人的天堂 | 高清日本在线成人免费视频 | 欧美日韩中文一区二区三区 | 成人免费视频网站 | 日本韩国一区 | 美女视频黄a全部免费专区一 | 操12p| 日韩国产欧美精品综合二区 | 日本三级全黄三级a | 亚洲成人手机在线 | 精品亚洲欧美高清不卡高清 | 日本高清免费视频色www | 91天仙tv嫩模福利 | 成人网视频在线观看免费 | 在线视频久草 | 草草久久97超级碰碰碰免费 | 久久久成人啪啪免费网站 |