Network Time service and chrony and operation and maintenance of the automated system deployment cobbler

Time synchronization and chrony

Time Synchronization: multi-host collaborative work time each host synchronization is very important, time inconsistency will cause a lot of failures of important applications, such as: encryption protocol, logging, clustering, etc., using the NTP (Network Time Protocol) protocol so that each network computer time to achieve synchronization. NTP is one of the basic services currently belong to operation and maintenance of the infrastructure necessary
time to achieve synchronization: ntp, chrony
ntp: the UTC synchronization clock and the world coordinate system, the precision of up to 0.1ms in the LAN, the vast majority on the Internet where accuracy can be achieved 1-50ms, the project's official website: HTTP: //www.ntp.org
chrony: NTP protocol to achieve free software. The system allows the NTP server clock, the reference clock (e.g. GPS receiver) and the use of manual input and keyboard synchronize watches. Can also serve as NTPv4 (RFC 5905) server and peer operation, the computer provides the network service time. Designed to run well under a variety of conditions, including intermittent and highly congested network connection, a temperature change (temperature sensitive computer clock), and can not run or continuous system running on the virtual machine. Typical accuracy through the Internet between two machines synchronized within a few milliseconds, in over LAN, you typically tens of microseconds accuracy. Using hardware or hardware reference clock time stamp, sub-microsecond accuracy can be achieved

chrony

chrony advantages:
faster sync just minutes instead of hours time, thereby minimizing the time and frequency error for the virtual machines running 24 hours a day is not very useful
to better respond to the clock frequency rapidly changing, unstable clock to have a virtual machine or cause a change in the clock frequency of energy-saving technology, which is very helpful
after the initial synchronization, it will not stop the clock to prevent monotonic application of the system needs time to impact
in addressing temporary asymmetrical delay (for example, when large-scale download link cause saturation) provides better stability
without the need to poll the server periodically, so the system has intermittent network connection can still be fast synchronous clock
chrony official website: https: //chrony.tuxfamily.org
chrony official document: https: //chrony.tuxfamily.org/documentation.html

Package: chrony
two main programs: chronyd and chronyc
chronyd: daemon running in the background, the system clock and the clock running in the kernel server is used to adjust the synchronization. It determines the ratio of increase or decrease in computer time and compensate
chronyc: command line user tool for monitoring the performance and diversity configuration. It may work on a computer-controlled chronyd instance, you can work on a different remote computer
services unit files: /usr/lib/systemd/system/chronyd.service
listening ports: 323 / udp, 123 / udp
profile : /etc/chrony.conf

Profile chrony.conf

server - can be used for clock server, when the server reachable iBurst option, transmitting a packet instead of the usual eight of a data packet. Packet interval is usually 2 seconds to accelerate the speed of initial synchronization
driftfile - computer ratio calculated based on the actual time changes in time, it will be recorded into a file, the system will compensate for the clock after the restart
rtcsync - kernel mode is enabled, the system 11 minutes each time will be copied to the real-time clock (the RTC)
the allow / the deny - Specifies a host, a subnet or a network to allow or deny access to the server
cmdallow / cmddeny - hosts which may be specified by the control command using chronyd
bindcmdaddress - chronyd which interface allows the listener to receive execution command chronyc
makestep - according to requirements by usually chronyd slow down or speed clock, so that the system gradually correct all the time offset. Under certain circumstances, the system clock may drift too fast, resulting in the adjustment process consumes very long time to correct the system clock. The instruction forces chronyd adjust the system clock is greater than a certain threshold adjustment of
local stratum 10 - even though the server instruction to a time server is unavailable, also allows the local time as the standard time timing when another client

chronyc command

chronyc command
help command to view more chronyc interactive command
accheck to check whether the current server to access a specific host
activity shows how many NTP source online / offline
sources [-v] display the current time synchronization information sources
sourcestats [-v] Displays the current synchronized time source of statistical information
to add a new NTP server add server manually
clients have access to the report server's client list
delete manually remove the NTP server or peer server
settime daemon manually set the time
sracking time information display system

chronyc example

[root@centos7 ~]#chronyc
chrony version 3.2
Copyright (C) 1997-2003, 2007, 2009-2017 Richard P. Curnow and others
chrony comes with ABSOLUTELY NO WARRANTY. This is free software, and
you are welcome to redistribute it under certain conditions. See the
GNU General Public License version 2 for details.
chronyc> clients
Hostname NTP Drop Int IntL Last Cmd Drop Int Last
===============================================================================
192.168.8.7 18 0 6 - 17 0 0 - -
192.168.8.6 14 0 6 - 56 0 0 - -
chronyc> activity
200 OK
1 sources online
0 sources offline
0 sources doing burst (return to online)
0 sources doing burst (return to offline)
0 sources with unknown address
chronyc> sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? 192.168.8.100 3 8 1 338 -40ms[ -40ms] +/- 237ms

NTP Public Services

pool.ntp.org: the project is to provide a reliable and easy to use NTP service of virtual cluster cn.pool.ntp.org, 0-3.cn.pool.ntp.org
Ali cloud public NTP server
Unix / linux type: ntp. aliyun.com, ntp1-7.aliyun.com
Windows categories: time.pool.aliyun.com
University ntp service
s1a.time.edu.cn Tsinghua University, Beijing University of Posts and Telecommunications s1b.time.edu.cn s1c.time.edu.cn Peking University
time Service Center, national server
210.72.145.44

Time tool timedatectl

Check the date and time, time zone and NTP status: timedatectl
When viewing zone list: timedatectl list-timezones
when modifying zone: timedatectl set-timezone Asia / Shanghai
change date and time: timedatectl set-time "2017-01-23 10:30:00 "
open NTP : timedatectl SET-NTP to true / flase
System-config-DATE: graphical configuration tools and services chrony

 

Guess you like

Origin www.cnblogs.com/quguwei/p/11093416.html