您的位置:首页 > 运维架构 > Linux

centos下 时间同步设置

2015-06-09 13:55 555 查看
1,
[root@localhost html]# yum -y install ntpdate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-19.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================
Package                                 Arch                                   Version                                                 Repository                            Size
===================================================================================================================================================================================
Installing:
ntpdate                                 x86_64                                 4.2.6p5-19.el7.centos                                   base                                  82 k

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

Total download size: 82 k
Installed size: 121 k
Downloading packages:
ntpdate-4.2.6p5-19.el7.centos.x86_64.rpm                                                                                                                    |  82 kB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ntpdate-4.2.6p5-19.el7.centos.x86_64                                                                                                                            1/1
Verifying  : ntpdate-4.2.6p5-19.el7.centos.x86_64                                                                                                                            1/1

Installed:
ntpdate.x86_64 0:4.2.6p5-19.el7.centos

Complete!

2,
[root@localhost etc]# rm -rf /etc/localtime
3,
[root@localhost etc]# vi /usr/share/zoneinfo/Asia/Shanghai
[root@localhost etc]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4,
[root@localhost etc]# ntpdate us.pool.ntp.org
9 Jun 13:47:47 ntpdate[5641]: step time server 74.120.8.2 offset -28798.525811 sec

5,
0 23 * * * ntpdate asia.pool.ntp.org >> /var/log/ntpdate.log
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: