Centos 時間同步
新裝的伺服器可能設定了錯誤的,需要調整時區並調整時間.如下是使用NTP來從一個時間伺服器同步
安裝NTP
[root@callcenterbak ~]# yum install ntp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.mirror.cdnetworks.com
* base: centos.ustc.edu.cn
* extras: centos.mirror.cdnetworks.com
* updates: centos.mirror.cdnetworks.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.2p1-9.el5.centos.2.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Updating:
ntp x86_64 4.2.2p1-9.el5.centos.2.1 base 1.3 M
Transaction Summary
=============================================================================================================================
Install 0 Package(s)
Update 1 Package(s)
Remove 0 Package(s)
Total download size: 1.3 M
Is this ok [y/N]: y
Downloading Packages:
ntp-4.2.2p1-9.el5.centos.2.1.x86_64.rpm | 1.3 MB 00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
base/gpgkey | 1.5 kB 00:00
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : ntp 1/2
Cleanup : ntp 2/2
Updated:
ntp.x86_64 0:4.2.2p1-9.el5.centos.2.1
Complete!
然後cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@callcenterbak ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp:是否覆蓋“/etc/localtime”? y
這一句是把當前時區調整為上海就是+8區,想改其他時區也可以去看看/usr/share/zoneinfo目錄;
最後同步時間:
[root@callcenterbak ~]# ntpdate us.pool.ntp.org
17 Nov 17:18:42 ntpdate[9562]: step time server 66.172.42.32 offset -28366.880328 sec
[root@localhost u01]# clock -w
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8183550/viewspace-678362/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos:時間同步CentOS
- centos7 時間自動同步CentOS
- CentOS命令修改系統時間同步CentOS
- Centos8中如何使用Chrony同步時間CentOS
- centos7的時間同步機制:chrony使用CentOS
- Centos7下用命令同步標準時間CentOS
- CentOS7使用NTP搭建時間同步伺服器CentOS伺服器
- Centos下部署NTP時間伺服器同步環境CentOS伺服器
- Centos系統伺服器設定時間自動同步!CentOS伺服器
- 同步vmware時間
- chrony時間同步
- NTP時間同步
- ntpd 時間同步
- 時間同步 - rdate
- centos下部署NTP時間伺服器同步環境記錄CentOS伺服器
- 叢集時間同步
- Linux同步時間Linux
- NTP配置時間同步
- Linux 時間同步Linux
- Linux時間同步Linux
- 同步vmware時間(ZT)
- NTP時間同步 For AIXAI
- Linux 時間同步Linux
- 時間同步的修改
- 再談時間同步
- 系統時間和硬體時間同步
- 修改CentOS伺服器時間為北京時間CentOS伺服器
- Centos 更改系統時間CentOS
- Linux下時間同步 ---夏令時Linux
- Linux下時間同步 --- 夏令時Linux
- ubuntu 修改時區或時間 及網路同步時間Ubuntu
- Linux ntpdate同步時間Linux
- Oracle叢集時間同步Oracle
- Linux 時間同步配置Linux
- puppet之crontab時間同步
- linux ntp時間同步Linux
- 時間同步(Arch Linux)Linux
- Linux使用ntp時間伺服器同步時間Linux伺服器