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

時間同步出錯

前沿拓展:

時間同步出錯

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


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

# 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]

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

時間同步出錯

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

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

# 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)閉硬件時鐘校準
# timedatectl set-local-rtc 0

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

再次運行 timedatectl,輸出結(jié)果中的 RTC in local TZ: no 表示硬件時鐘已經(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ù)處于不活動狀態(tài),那么可以使用下面的命令激活它

timedatectl set-ntp true

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

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

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

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

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

重啟服務(wù)

systemctl restart chronyd

查看服務(wù)

# chronyc sourcestats -v

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

timedatectl set-timezone Asia/Shanghai

拓展知識:

前沿拓展:

時間同步出錯

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


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

# 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]

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

時間同步出錯

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

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

# 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)閉硬件時鐘校準
# timedatectl set-local-rtc 0

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

再次運行 timedatectl,輸出結(jié)果中的 RTC in local TZ: no 表示硬件時鐘已經(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ù)處于不活動狀態(tài),那么可以使用下面的命令激活它

timedatectl set-ntp true

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

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

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

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

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

重啟服務(wù)

systemctl restart chronyd

查看服務(wù)

# chronyc sourcestats -v

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

timedatectl set-timezone Asia/Shanghai

拓展知識:

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