NTP服务部署(centos7)

NTP服务在大数据集群部署时时一个很关键的步骤,集群时间不对会导致很多问题

1.yum安装ntp服务
	yum -y install ntp
	
离线安装需要三个包
	ntp.x86_64 0:4.2.6p5-28.el7.centos                                                             
	autogen-libopts.x86_64 0:5.18-5.el7
	ntpdate.x86_64 0:4.2.6p5-28.el7.centos

2.配置服务端 vi /etc/ntp.conf

配置服务端 vi /etc/ntp.conf 

	#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
#修改为--允许192.168.11.x网段内所有的主机访问
	restrict 192.168.11.0 mask 255.255.255.0 nomodify notrap
#注释掉下面的4行
	#server 0.centos.pool.ntp.org iburst
	#server 1.centos.pool.ntp.org iburst
	#server 2.centos.pool.ntp.org iburst
	#server 3.centos.pool.ntp.org iburst
	
#添加常用的授时服务器,允许上层时间服务器主动修改本机时间
	server ntp1.aliyun.com
	server time1.aliyun.com
	server 127.127.1.0 	# 本地时钟服务器

3.服务端测试—主要是2个命令,具体含义可以自行Google

重启ntp服务
	systemctl restart ntpd
查看同步状态
[root@cdh11 network-scripts]# ntpq -p
     remote           refid      st t when poll reac
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值