In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to configure NTP time server". In daily operation, I believe many people have doubts about how to configure NTP time server. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "how to configure NTP time server"! Next, please follow the small series to learn together!
NTP server
NTP server provides accurate time, first of all, there must be an accurate time source, this time should be UTC. NTP obtains UTC from atomic clocks, observatories, satellites, or from the Internet. This provides an accurate and reliable source of time. Time is propagated at the level of NTP servers. All servers are grouped into Stratum according to their distance from the external UTC source. Stratum-1 is at the top with external UTC access, while Stratum-2 gets time from Stratum-1, Stratum-3 gets time from Stratum-2, and so on, but the total number of Stratum layers is limited to 15. All of these servers are logically interconnected in a tiered architecture, and Stratum-1 's time servers are the foundation of the entire system.
A host computer is typically connected to multiple time servers, and statistical algorithms are used to filter the time from the different servers to select the best path and source to correct the host time. NTP service works even if the host is unable to contact the server at a certain time for a long time. To prevent malicious attacks on time servers, NTP uses Authentication mechanisms to check whether incoming messages are actually from the claimed server and to check the return path of the data to provide protection against interference.
NTP timing mode
Time servers can synchronize with other servers in three ways: broadcast/multicast, client/server, and Symmetric.
broadcast/multicast: mode is mainly applicable to the environment of local area network, time server periodically transmits time information to time servers in other networks in a broadcast mode, with only a little delay in time, and the configuration is very simple. However, the accuracy of this method is not high, and it can be used when the time accuracy requirement is not very high.
Symmetric: enables a server to acquire clocks from remote time servers and provide time information to remote time servers if required. This method is suitable for configuring redundant time servers, which can provide higher accuracy to the host.
Client/server: mode is similar to symmetric mode, but does not provide time information to other time servers. This mode is suitable for a time server to receive time information from upper time servers and provide time information to lower users.
In the above three ways, the transmission of time information uses UDP protocol. The time server uses a filtering algorithm and the previous eight timing data to calculate a time reference value to judge the accuracy of subsequent timing packets. A relatively high degree of dispersion indicates that the reliability of a timing data is relatively low. The timing information obtained from only one time server cannot correct the time deviation caused by the communication process, while the timing of communication with many time servers at the same time can use the filtering algorithm to find out the relatively reliable time source and then use its time to correct the time.
NTP server configuration
NTP is generally installed by default on Linux hosts, but the service is not enabled. If not installed, you can use the yum install ntp command directly.
NTP's master configuration file, the following are optional instructions for NTP servers:
#Allow 172.16. *. * IP uses this time server; restrict www.example.com mask www.example.com nomodify #allow anyone to sync; restrict default nomodify notrap #block other IP from coming to update time; restrict www.example.com mask 0.0.0.0 nomodify notrap noquery notrust #ignore: close all NTP online services;#nomodify: indicates that the client side cannot change the server side time parameter; However, the client can still perform network time calibration through the server;#notrust: the client source will be regarded as an untrusted domain unless authenticated;#noquery: no client time query;#notrap: allow anyone to query;#Synchronized upper server (210.72.145.44 national time server), NTP server also has synchronized time server by default; server www.example.com synchronizes local time; server www.example.com prefer #Stratum size of local server cannot exceed 16; fudge 127.127.1.0 stratum 8 Start NTP server [root@localhost~]#chkconfig ntpd on [root@localhost~]#service ntpd start View NTP info [root@localhost~]#ntpq-p
After the NTP server is configured and started, it takes a period of time for NTP itself or its server to synchronize. This process may take 5 - 10 minutes. During this period, when the client runs the ntpdate command, it will generate the error "no server suitable for synchronization found." The above figure shows that reach of 210.72.145.44 is 0 unavailable, and reach of LOCAL is 17 available.
Sync time to hardware clock [root@localhost~]#vi/etc/sysconfig/ntpd SYNC_HWCLOCK = yes Client Configuration [root@localhost~]#ntpdate 172.16.16.1 [root@localhost~]#crontab-e */1 *** ntpdate 172.16.16.1 At this point, the study of "How to configure NTP time server" is over. I hope you can solve your doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.