In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1 build NTP server ready to build environment host IPOS remarks NTP Server192.168.5.180CentOS 6
NTP Client192.168.5.181CentOS 6
1.1 install NTP service program [root@node1 ~] # rpm-qa | grep ntp # query whether to install ntp service program [root@node1] # yum install-y ntp # install ntp service program 1.2 configure NTP service program red for added configuration The rest is the default configuration [root@node1 ~] # cp / etc/ntp.conf { .bak} # backup ntp configuration file [root@node1 ~] # vim / etc/ntp.conf # Edit ntp configuration file [root@node1 ~] # grep-Ev'^ $| ^ # / etc/ntp.confdriftfile / var/lib/ntp/driftrestrict default kod nomodify notrap nopeer noqueryrestrict-6 default kod nomodify notrap nopeer noqueryrestrict 127.0.0.1 restrict-6:: 1restrict 192.168.5.0 mask 255.255.255.0 nomodify notrap # allows hosts in this network segment to enter Row time restrict 0.0.0.0 mask 0.0.0.0 nomodify notrapserver time.nist.gov prefer # upper layer NTP server address Prefer indicates priority for server 0.centos.pool.ntp.org iburstserver 1.centos.pool.ntp.org iburstserver 2.centos.pool.ntp.org iburstserver 3.centos.pool.ntp.org iburstincludefile / etc/ntp/crypto/pwkeys / etc/ntp/keys1.3 to start the NTP service program # chkconfig ntpd on# / etc/init.d/ntpd start
# / etc/init.d/ntpd stop# / etc/init.d/ntpd restart
View the NTP-enabled port [root@node1 ~] # netstat-tlunp | grep ntpudp 0 0 192.168.5.180 netstat 123 0.0.0. 0 28331/ntpdudp 0 0 127.0.0.1 netstat 123 0.0. 0 tlunp * 28331/ntpdudp 0 0 0. 0. 0. 0. 0. 12. 0. 0. : * 28331/ntpdudp 0 0:: 123: * 28331/ntpd
1.4 check NTP service status now the ntp server has been started, but it still takes some time to connect with the upper-level server. It usually takes 15 minutes to connect with the upper-level NTP server after starting NTP. How can I be sure that the NTP server has successfully updated its own time? You can use the following commands to view [root@node1 ~] # ntpstatsynchronised to NTP server (94.237.64.20) at stratum 3 time correct to within 362 mspolling server every 64 s this command lists whether the NTP server has been connected to the upper NTP server. From the above output, you can know that the time has been corrected to about 362ms, and will actively update every 64 seconds.
[root@node1] # ntpq-premote refid st t when poll reach delay offset jitter====time-a.nist.gov .INIT. 16 u-128 0.000 0.000 0.000*makaki.miuku.ne 218.186.3.36 2 u 16 64 377 269.215 44.744 69.262+ntp1.ams1.nl.le 130.133.1.10 2 u 21 64 377 271.981-32.490 66.809+ntp.wdc1.us.lea 130.133.1.10 2 u 22 64 337 308.368-6.923 90.30061-216mur104. 62.161.56.158 3u 38 64 21 80.450-33.733 23.397 Note:
The ntpq-p command can list the current connection status between our NTP server and the upper NTP server. The meanings of the above fields are as follows: remote: the IP or hostname of the NTP host; note the symbol on the left: *: indicates the NTP server in use +: indicates the NTP server that has been successfully connected but provides time updates as a standby; refid: the address of the upper NTP server St: stratum hierarchical when: time synchronization update operation was done a few seconds ago; pool: the next update is a few seconds later; reach: the number of updates that have been requested from the upper NTP server; delay: the time delay during network transmission, in 10-6 seconds; offset: time compensation result, in 10-3 seconds; jitter: the time difference between the system time and the BIOS hardware time, in 10-6 seconds
2 NTP client configuration Client:192.168.5.181 [root@node2 tools] # ntpdate 192.168.5.18015 Jun 14:36:19 ntpdate [24881]: adjust time server 192.168.5.180 offset-0.002062 sec [root@node2 tools] # hwclock-w # write system time to BIOS hardware time [root@node2 tools] # hwclock Thu 15 Jun 2017 03:46:26 PM CST-0.860434 seconds [root@node2 tools] # dateThu Jun 15 15:46:38 CST 2017 [root@node2 tools] # crontab-e # configure scheduled tasks The system automatically calibrates time with NTP server 192.168.5.180 every 3 minutes.
* / 3 * (/ usr/sbin/ntpdate 192.168.5.180 & & / sbin/hwclock-w) & > / dev/null
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.