欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > windows >内容正文

windows

Centos7系统、Hadoop集群上部署ntp服务器

发布时间:2025/3/16 windows 22 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Centos7系统、Hadoop集群上部署ntp服务器 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

集群情况:

三台机器分别:

master:180.201.163.46

slave1:180.201.156.76
slave2:180.201.130.17

网关:255.255.192.0

在slave1配置ntpserver,在master和slave2上配置ntpclient。

1、检查ntp软件包是否安装
# rpm -qa | grep ntp
ntp-4.2.4p8-3.el6.centos.x86_64
# yum -y install ntp --如果没有安装需要安装ntp

2、修改slave1上的ntp配置文件(ntpserver)
# vi /etc/ntp.conf,如下

For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. restrict default nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. restrict 127.0.0.1 restrict ::1# Hosts on local network are less restricted. restrict 180.201.0.0 mask 255.255.192.0 nomodify notrap# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html).server 210.72.145.44 iburst prefer server 202.112.10.36 iburst server 59.124.196.83 iburstrestrict 210.72.145.44 modify notrap noquery restrict 202.112.10.36 modify notrap noquery restrict 59.124.196.83 modify notrap noqueryserver 127.127.1.0 fudge 127.127.1.0 stratum 10#broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client# Enable public key cryptography. #cryptoincludefile /etc/ntp/crypto/pw# Key file containing the keys and key identifiers used when operating # with symmetric key cryptography. keys /etc/ntp/keys# Specify the key identifiers which are trusted. #trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility. #requestkey 8# Specify the key identifier to use with the ntpq utility. #controlkey 8# Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats# Disable the monitoring facility to prevent amplification attacks using ntpdc # monlist command when default restrict does not include the noquery flag. See # CVE-2013-5211 for more details. # Note: Monitoring will not be disabled with the limited restriction flag. disable monitor

介绍请见

3、修改master和slave2上的ntp配置文件(ntpclient)
# vi /etc/ntp.conf,如下

# For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. restrict default nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. restrict 127.0.0.1 restrict ::1# Hosts on local network are less restricted. #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html).server slave1 iburst restrict slave1 mask nomodify notrap noqueryserver 127.127.1.0 fudge 127.127.1.0 stratum 10#broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client# Enable public key cryptography. #cryptoincludefile /etc/ntp/crypto/pw# Key file containing the keys and key identifiers used when operating # with symmetric key cryptography. keys /etc/ntp/keys# Specify the key identifiers which are trusted. #trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility. #requestkey 8# Specify the key identifier to use with the ntpq utility. #controlkey 8# Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats# Disable the monitoring facility to prevent amplification attacks using ntpdc # monlist command when default restrict does not include the noquery flag. See # CVE-2013-5211 for more details. # Note: Monitoring will not be disabled with the limited restriction flag. disable monitor

介绍如下:

4、启动

# service ntpd start -- 启动ntp
# chkconfig ntpd on --开机启动
# service ntpd status --查看状态

# ntpstat查看同步情况,如下则表示启动成功

synchronised to NTP server (85.199.214.101) at stratum 2 time correct to within 155 mspolling server every 64 s

 

与50位技术专家面对面20年技术见证,附赠技术全景图

总结

以上是生活随笔为你收集整理的Centos7系统、Hadoop集群上部署ntp服务器的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。