First, the Yum source configuration
1, enter the Yum source configuration directory
Cd/etc/yum.repos.d
2, the backup system comes with the Yum source
MV Centos-base.repo CENTOS-BASE.REPO.BK
Download 163 NetEase's Yum Source:
wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo
3, after updating the Yum source, perform the following command to update the Yum configuration so that the operation takes effect immediately
Yum Makecache
Yum list test plus cache update
4, in addition to NetEase, there are other good sources of Yum, such as Zhong Ke and Sohu, we can download according to their own needs
Zhong Ke's yum Source:
wget Http://centos.ustc.edu.cn/CentOS-Base.repo
Sohu's Yum Source
wget Http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
Ali Yum Source
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repo
Second, update the system time net
One, update time from the time server with Ntpdate
If your Linux system doesn't ntpdate this command at all,
Yum Install Ntp-y
After the installation, you do not have to do any configuration, and do not need to test directly
[Email protected] ~]# ntpdate time.nist.gov Oct 21:11:43 ntpdate[5014]: Adjust time server 207.200.81.113 offset-0.01 8788 sec
If you go out above the description, the synchronization was successful. Then add the following to the crontab.
*/10 * * * * * ntpdate time.nist.gov #域名或IP
Synchronize every 10 minutes. Several time servers are recommended.
Time.nist.gov
Time.nuri.net
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org
Second, use NTP to build your own time server
Above, we use other people's time server to synchronize time, these time servers are more authoritative. When we build our own time server, we don't have to crontab to run regularly.
1, install time server NTP
Yum Install NTP
2, configuring NTP
View copy print?
[[email protected] ~]# cat/etc/ntp.conf |awk ' {if ($!~/^$/&& $!~/^#/) {print $}} ' restrict default ignore
//default is not allowed to modify or query NTP, and does not receive special packets restrict 127.0.0.1 //give native all rights restrict 192.168.1.0 mask 255.255.255.0 notrap Nomodify//The machine that gives the LAN machine has synchronization time permissions server time.nist.gov prefer //Set time server, plus prefer to express priority server 0.asia.pool.ntp.org Server 1.asia.pool.ntp.org Server 2.asia.pool.ntp.org server 127.127.1.0 # Local clock fudge 127.127.1.0 Stratum driftfile/var/lib/ntp/drift Keys/etc/ntp/keys
3, start NTP
[[email protected] ~]#/etc/init.d/ntpd start
4, view and test
[Email protected] ~]# NETSTAT-UPNL |grep ntpd //view time [[email protected] ~]# NTPQ-PN //view synchronized server IP remote ref ID St T when poll reach delay offset jitter ======================================================= ======================= 50.77.217.185 . INIT. U - 0 0.000 0.000 0.000 202.90.158.4 . INIT. U - 0 0.000 0.000 0.000 202.71.100.89 . INIT. U - 0 0.000 0.000 0.000 202.134.1.10 . INIT. U - 0 0.000 0.000 0.000 *127.127.1.0 . Locl. Ten l 377 0.000 0.000 0.001 [[email protected] ~]# Ntpstat // Synchronization results synchronised to local net at stratum one time correct to within MS polling server every
Remote: The IP or host name of the NTP host. Note that the leftmost symbol, if by "+" represents the upper level NTP that is currently acting on the clock, if "*" indicates that there is also a connection, but as a secondary online NTP host.
refID: Reference to the address of the previous layer of NTP host
ST: the stratum stratum
When: A few seconds ago there was a time synchronization update operation
Poll: Next update after a few seconds
Reach: Number of updates that have been requested for the upper NTP server
Delay: The time the network transmission process clock is delayed
Offset: The result of time compensation
Jitter:linux time difference between system time and BIOS hardware time
Recommend the first method, although the establishment of a time server, or relatively simple, but I do not think it is necessary. If you use someone else's time server, synchronize every 10 minutes, can be accurate to milliseconds.
Author: submarine Eagle
Address: http://blog.51yip.com/server/1474.html
CentOS and Redhat Series systems Yum Source configuration, time synchronization