centos系統時間同步方法

 

安裝同步時間工具ntpdate

yum -y install ntp

 同步時間

[root@manage-host ~]# ntpdate ntp1.aliyun.com
25 Apr 00:53:42 ntpdate[26662]: step time server 120.25.115.20 offset -0.597768 sec

centos8時間同步

下載安裝工具包

[root@master dashboard]# rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
Retrieving http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:wlnmp-release-centos-1-1         ################################# [100%]

安裝工具

[root@master dashboard]# yum -y install wntp
Failed to set locale, defaulting to C.UTF-8
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
wlnmp                                                                                                                       322 kB/s | 598 kB     00:01    
Dependencies resolved.
============================================================================================================================================================
 Package                           Architecture                        Version                                     Repository                          Size
============================================================================================================================================================
Installing:
 wntp                              x86_64                              4.2.8p13-1.el8                              wlnmp                              1.9 M

Transaction Summary
============================================================================================================================================================
Install  1 Package

Total download size: 1.9 M
Installed size: 4.7 M
Downloading Packages:
wntp-4.2.8p13-1.el8.x86_64.rpm                                                                                              5.7 MB/s | 1.9 MB     00:00    
------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                       5.7 MB/s | 1.9 MB     00:00     
warning: /var/cache/dnf/wlnmp-57c61db0c3752e99/packages/wntp-4.2.8p13-1.el8.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID bcc6a00d: NOKEY
wlnmp                                                                                                                       955  B/s | 1.7 kB     00:01    
Importing GPG key 0xBCC6A00D:
 Userid     : "wlnmp (GPG-RPM-KEY) <[email protected]>"
 Fingerprint: 5D5B 5609 0305 9039 D96E 717C 9F3B A65F BCC6 A00D
 From       : http://mirrors.wlnmp.com/centos/RPM-GPG-KEY-wlnmp
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                    1/1 
  Running scriptlet: wntp-4.2.8p13-1.el8.x86_64                                                                                                         1/1 
  Installing       : wntp-4.2.8p13-1.el8.x86_64                                                                                                         1/1 
  Running scriptlet: wntp-4.2.8p13-1.el8.x86_64                                                                                                         1/1 
  Verifying        : wntp-4.2.8p13-1.el8.x86_64                                                                                                         1/1 

Installed:
  wntp-4.2.8p13-1.el8.x86_64                                                                                                                                

Complete!

同步阿里雲時間

[root@master dashboard]# date
Sat Apr 25 08:44:24 CST 2020
[root@master dashboard]# ntpdate ntp1.aliyun.com
25 Apr 00:46:45 ntpdate[90628]: step time server 120.25.115.20 offset -28804.884347 sec
[root@master dashboard]# date
Sat Apr 25 00:46:48 CST 2020

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章