久久亚洲精品国产精品_羞羞漫画在线版免费阅读网页漫画_国产精品久久久久久久久久久久_午夜dj免费观看在线视频_希崎杰西卡番号

時(shí)間同步出錯(cuò)

前沿拓展:

時(shí)間同步出錯(cuò)

Windows與Internet時(shí)間同步不上,大致有兩種狀況: 爭(zhēng)歷沿粒魯房消1、在獲取最近一次同過(guò)Windows XP中內(nèi)置的Internet連接防火墻除外。 如果以上兩種方法還沒(méi)有解決,將“自動(dòng)與 Internet 時(shí)間


打開虛擬機(jī)進(jìn)入AlmaLinux,使用 dnf install mysql安裝mysql數(shù)據(jù)庫(kù),突然彈出如下所示的錯(cuò)誤:

# dnf module list mysql
AlmaLinux 8 – BaseOS 0.0 B/s | 0 B 00:10
Errors during downloading metadata for repository 'baseos':
– Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://mirrors.almalinux.org/mirrorlist/8/baseos [SSL certificate problem: certificate is not yet valid]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://mirrors.almalinux.org/mirrorlist/8/baseos [SSL certificate problem: certificate is not yet valid]

頓時(shí)蒙了,使用ping檢查一下網(wǎng)絡(luò),一切正常,哪里出錯(cuò)了呢?只能搜索一下,可能是虛擬機(jī)的系統(tǒng)時(shí)間不對(duì)導(dǎo)致的??赡苁且?yàn)樘摂M機(jī)沒(méi)有電池,無(wú)法記住時(shí)間,因此需要同步時(shí)間,centos8 和 rocky linux 8 默認(rèn)不帶ntpdate,可以使用chrony進(jìn)行時(shí)間同步,chrony也是一個(gè)ntp協(xié)議的實(shí)現(xiàn),默認(rèn)安裝。

時(shí)間同步出錯(cuò)

第一使用 timedatectl 查詢一下系統(tǒng)時(shí)鐘。

timedatectl命令可以查詢和更改系統(tǒng)時(shí)鐘和設(shè)置,你可以使用此命令來(lái)設(shè)置或更改當(dāng)前的日期,時(shí)間和時(shí)區(qū),或?qū)崿F(xiàn)與遠(yuǎn)程N(yùn)TP服務(wù)器的自動(dòng)系統(tǒng)時(shí)鐘同步。

# timedatectl
Warning: The system is configured to read the RTC time in the local time zone.

This mode cannot be fully supported. It will create various problems

with time zone changes and daylight saving time adjustments. The RTC

time is never updated, it relies on external facilities to maintain it.

If at all possible, use RTC in UTC by calling

'timedatectl set-local-rtc 0'.
// 關(guān)閉硬件時(shí)鐘校準(zhǔn)
# timedatectl set-local-rtc 0

根據(jù)輸出結(jié)果,系統(tǒng)啟用了硬件校準(zhǔn)時(shí)間,可是虛擬機(jī)沒(méi)有硬件時(shí)鐘,根據(jù)提示輸入命令 timedatectl set-local-rtc 0 關(guān)閉硬件校準(zhǔn)時(shí)間。

再次運(yùn)行 timedatectl,輸出結(jié)果中的 RTC in local TZ: no 表示硬件時(shí)鐘已經(jīng)關(guān)閉。

# timedatectl
Local time: Sat 2022-11-26 05:17:00 EST
Universal time: Sat 2022-11-26 10:17:00 UTC
RTC time: Sat 2022-11-26 10:17:00
Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

如果輸出結(jié)果中的NTP service服務(wù)處于不活動(dòng)狀態(tài),那么可以使用下面的命令激活它

timedatectl set-ntp true

此時(shí)運(yùn)行 dnf install mysql 應(yīng)該正常了,如果不正常,那么重啟chrony服務(wù)或者等一會(huì)。

chrony是一個(gè)ntp協(xié)議的實(shí)現(xiàn)程序,既可以當(dāng)做服務(wù)端,也可以充當(dāng)客戶端;它專為間歇性互聯(lián)網(wǎng)連接的系統(tǒng)而設(shè)計(jì),當(dāng)然也能良好應(yīng)用于持久互聯(lián)網(wǎng)連接的環(huán)境;chrony有三個(gè)時(shí)間參考:硬件時(shí)鐘、實(shí)時(shí)時(shí)鐘以及手動(dòng)同步。

RHEL7中默認(rèn)使用chrony作為時(shí)間服務(wù)器,也支持NTP,需要額外安裝。NTP與chrony不能同時(shí)存在,只能用其中一個(gè),并將另一個(gè)mask掉。

還可以在chrony配置文件中添加 阿里云和國(guó)家授時(shí)中心,這樣校時(shí)更快。

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).
//注釋掉默認(rèn)的服務(wù)器
#pool 2.pool.ntp.org iburst
//添加阿里云和國(guó)家授時(shí)中心
server ntp.aliyun.com iburst
server ntp.ntsc.ac.cn iburst

重啟服務(wù)

systemctl restart chronyd

查看服務(wù)

# chronyc sourcestats -v

使用timedatectl還可以將時(shí)區(qū)設(shè)置為亞洲上海。

timedatectl set-timezone Asia/Shanghai

拓展知識(shí):

前沿拓展:

時(shí)間同步出錯(cuò)

Windows與Internet時(shí)間同步不上,大致有兩種狀況: 爭(zhēng)歷沿粒魯房消1、在獲取最近一次同過(guò)Windows XP中內(nèi)置的Internet連接防火墻除外。 如果以上兩種方法還沒(méi)有解決,將“自動(dòng)與 Internet 時(shí)間


打開虛擬機(jī)進(jìn)入AlmaLinux,使用 dnf install mysql安裝mysql數(shù)據(jù)庫(kù),突然彈出如下所示的錯(cuò)誤:

# dnf module list mysql
AlmaLinux 8 – BaseOS 0.0 B/s | 0 B 00:10
Errors during downloading metadata for repository 'baseos':
– Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://mirrors.almalinux.org/mirrorlist/8/baseos [SSL certificate problem: certificate is not yet valid]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://mirrors.almalinux.org/mirrorlist/8/baseos [SSL certificate problem: certificate is not yet valid]

頓時(shí)蒙了,使用ping檢查一下網(wǎng)絡(luò),一切正常,哪里出錯(cuò)了呢?只能搜索一下,可能是虛擬機(jī)的系統(tǒng)時(shí)間不對(duì)導(dǎo)致的??赡苁且?yàn)樘摂M機(jī)沒(méi)有電池,無(wú)法記住時(shí)間,因此需要同步時(shí)間,centos8 和 rocky linux 8 默認(rèn)不帶ntpdate,可以使用chrony進(jìn)行時(shí)間同步,chrony也是一個(gè)ntp協(xié)議的實(shí)現(xiàn),默認(rèn)安裝。

時(shí)間同步出錯(cuò)

第一使用 timedatectl 查詢一下系統(tǒng)時(shí)鐘。

timedatectl命令可以查詢和更改系統(tǒng)時(shí)鐘和設(shè)置,你可以使用此命令來(lái)設(shè)置或更改當(dāng)前的日期,時(shí)間和時(shí)區(qū),或?qū)崿F(xiàn)與遠(yuǎn)程N(yùn)TP服務(wù)器的自動(dòng)系統(tǒng)時(shí)鐘同步。

# timedatectl
Warning: The system is configured to read the RTC time in the local time zone.

This mode cannot be fully supported. It will create various problems

with time zone changes and daylight saving time adjustments. The RTC

time is never updated, it relies on external facilities to maintain it.

If at all possible, use RTC in UTC by calling

'timedatectl set-local-rtc 0'.
// 關(guān)閉硬件時(shí)鐘校準(zhǔn)
# timedatectl set-local-rtc 0

根據(jù)輸出結(jié)果,系統(tǒng)啟用了硬件校準(zhǔn)時(shí)間,可是虛擬機(jī)沒(méi)有硬件時(shí)鐘,根據(jù)提示輸入命令 timedatectl set-local-rtc 0 關(guān)閉硬件校準(zhǔn)時(shí)間。

再次運(yùn)行 timedatectl,輸出結(jié)果中的 RTC in local TZ: no 表示硬件時(shí)鐘已經(jīng)關(guān)閉。

# timedatectl
Local time: Sat 2022-11-26 05:17:00 EST
Universal time: Sat 2022-11-26 10:17:00 UTC
RTC time: Sat 2022-11-26 10:17:00
Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

如果輸出結(jié)果中的NTP service服務(wù)處于不活動(dòng)狀態(tài),那么可以使用下面的命令激活它

timedatectl set-ntp true

此時(shí)運(yùn)行 dnf install mysql 應(yīng)該正常了,如果不正常,那么重啟chrony服務(wù)或者等一會(huì)。

chrony是一個(gè)ntp協(xié)議的實(shí)現(xiàn)程序,既可以當(dāng)做服務(wù)端,也可以充當(dāng)客戶端;它專為間歇性互聯(lián)網(wǎng)連接的系統(tǒng)而設(shè)計(jì),當(dāng)然也能良好應(yīng)用于持久互聯(lián)網(wǎng)連接的環(huán)境;chrony有三個(gè)時(shí)間參考:硬件時(shí)鐘、實(shí)時(shí)時(shí)鐘以及手動(dòng)同步。

RHEL7中默認(rèn)使用chrony作為時(shí)間服務(wù)器,也支持NTP,需要額外安裝。NTP與chrony不能同時(shí)存在,只能用其中一個(gè),并將另一個(gè)mask掉。

還可以在chrony配置文件中添加 阿里云和國(guó)家授時(shí)中心,這樣校時(shí)更快。

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).
//注釋掉默認(rèn)的服務(wù)器
#pool 2.pool.ntp.org iburst
//添加阿里云和國(guó)家授時(shí)中心
server ntp.aliyun.com iburst
server ntp.ntsc.ac.cn iburst

重啟服務(wù)

systemctl restart chronyd

查看服務(wù)

# chronyc sourcestats -v

使用timedatectl還可以將時(shí)區(qū)設(shè)置為亞洲上海。

timedatectl set-timezone Asia/Shanghai

拓展知識(shí):

原創(chuàng)文章,作者:九賢生活小編,如若轉(zhuǎn)載,請(qǐng)注明出處:http://www.cddhlm.com/56246.html