-->
当前位置:首页 > ELSE > 正文内容

Luz5年前 (2019-12-22)ELSE4020
[root@localhost ~]# dateWed Jun 19 22:17:50 EDT 2019

时间与本地计算机时间快了12小时,查看网上类似问题方案是同步远端服务器的时间

ntp常用服务器

国家授时中心:210.72.145.44
NTP服务器(上海) :ntp.api.bz

尝试修改时间:

下载时间同步模块


 1 [root@localhost ~]# yum -y install ntpdate 2 Loaded plugins: fastestmirror 3 base                                                     | 3.6 kB     00:00      4 extras                                                   | 3.4 kB     00:00      5 updates                                                  | 3.4 kB     00:00      6 (1/2): extras/7/x86_64/primary_db                          | 205 kB   00:00      7 (2/2): updates/7/x86_64/primary_db                         | 6.4 MB   00:05      8 Loading mirror speeds from cached hostfile 9  * base: mirrors.zju.edu.cn10  * extras: ap.stykers.moe11  * updates: ap.stykers.moe12 Resolving Dependencies13 --> Running transaction check14 ---> Package ntpdate.x86_64 0:4.2.6p5-28.el7.centos will be installed15 --> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: ntpdate-4.2.6p5-28.el7.centos.x86_6416 --> Running transaction check17 ---> Package openssl-libs.x86_64 1:1.0.1e-42.el7.9 will be updated18 --> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-42.el7.9 for package: 1:openssl-1.0.1e-42.el7.9.x86_6419 ---> Package openssl-libs.x86_64 1:1.0.2k-16.el7_6.1 will be an update20 --> Running transaction check21 ---> Package openssl.x86_64 1:1.0.1e-42.el7.9 will be updated22 ---> Package openssl.x86_64 1:1.0.2k-16.el7_6.1 will be an update23 --> Finished Dependency Resolution24 25 Dependencies Resolved26 27 ================================================================================28  Package           Arch        Version                       Repository    Size29 ================================================================================30 Installing:31  ntpdate           x86_64      4.2.6p5-28.el7.centos         base          86 k32 Updating for dependencies:33  openssl           x86_64      1:1.0.2k-16.el7_6.1           updates      493 k34  openssl-libs      x86_64      1:1.0.2k-16.el7_6.1           updates      1.2 M35 36 Transaction Summary37 ================================================================================38 Install  1 Package39 Upgrade             ( 2 Dependent packages)40 41 Total download size: 1.8 M42 Downloading packages:43 Delta RPMs disabled because /usr/bin/applydeltarpm not installed.44 (1/3): ntpdate-4.2.6p5-28.el7.centos.x86_64.rpm            |  86 kB   00:00     45 (2/3): openssl-1.0.2k-16.el7_6.1.x86_64.rpm                | 493 kB   00:00     46 (3/3): openssl-libs-1.0.2k-16.el7_6.1.x86_64.rpm           | 1.2 MB   00:18     47 --------------------------------------------------------------------------------48 Total                                               96 kB/s | 1.8 MB  00:18     49 Running transaction check50 Running transaction test51 Transaction test succeeded52 Running transaction53   Updating   : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                      1/5 54   Updating   : 1:openssl-1.0.2k-16.el7_6.1.x86_64                           2/5 55   Installing : ntpdate-4.2.6p5-28.el7.centos.x86_64                         3/5 56   Cleanup    : 1:openssl-1.0.1e-42.el7.9.x86_64                             4/5 57   Cleanup    : 1:openssl-libs-1.0.1e-42.el7.9.x86_64                        5/5 58   Verifying  : 1:openssl-1.0.2k-16.el7_6.1.x86_64                           1/5 59   Verifying  : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                      2/5 60   Verifying  : ntpdate-4.2.6p5-28.el7.centos.x86_64                         3/5 61   Verifying  : 1:openssl-libs-1.0.1e-42.el7.9.x86_64                        4/5 62   Verifying  : 1:openssl-1.0.1e-42.el7.9.x86_64                             5/5 63 64 Installed:65   ntpdate.x86_64 0:4.2.6p5-28.el7.centos                                        
66 67 Dependency Updated:68   openssl.x86_64 1:1.0.2k-16.el7_6.1   openssl-libs.x86_64 1:1.0.2k-16.el7_6.1  69 70 Complete!

尝试同步远程服务器

[root@localhost ~]# ntpdate -u 210.72.145.44

返回错误:

19 Jun 22:23:08 ntpdate[3361]: no server suitable for synchronization found

尝试修改文件:


[root@localhost ~]# ntpdate -u ntp.api.bz19 Jun 22:24:20 ntpdate[3362]: step time server 114.118.7.161 offset 3.555703 sec
[root@localhost ~]# dateWed Jun 19 22:24:31 EDT 2019[root@localhost ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtimecp: overwrite ‘/etc/localtime’? y
[root@localhost ~]# ntpdate pool.ntp.org 
20 Jun 10:27:29 ntpdate[3366]: adjust time server 119.28.183.184 offset 0.079637 sec
[root@localhost ~]# dateThu Jun 20 10:27:40 CST 2019


发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。