集群时间同步

1、rpm -qa | grep ntp 查看服务是否已安装
查看ntp 和ntpdate 是否安装
2、如果没有安装(主机)
1>搜索:yum list | grep ntp
搜索ntp
2>安装(主机)
yum -y install ntp.x86_64(小编这里是ntp.x86_64)
3、配置时间服务器
vi /etc/ntp.conf

# Hosts on local network are less restricted. 
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap 
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 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 127.127.1.0(本地模式)

4、安装ntp客户端(有的跳过)(子机)
yum -y install ntpdate.x86_64
5、自动同步(子机)
crontab -e

*/1 * * * * /usr/sbin/ntpdate hadoop1 >> /dev/null
#一分钟同步一次,hadoop1改为自己校准时间的主机

6、开机启动(子机)
chkconfig ntpd on

如果自动同步失败
查看日志
cat /var/spool/mail/root

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值