每天一点hadoop 第十一篇 (时间同步)

在部署Spark集群时遇到从节点启动时间超时问题,解决方法是通过NTP进行时间同步。具体操作包括安装ntp,修改配置文件,设置服务器并调整其他节点与主节点的时间同步。通过ntpdate命令和service ntpd命令确保所有节点时间一致。
摘要由CSDN通过智能技术生成

在centos集群中进行spark部署时,无法启动从节点主要就是时间超时

对时间进行同步:

1.       安装 ntp :yum intall ntp

2.       修改配置文件:vi  /etc/ntp.conf

  server127.127.1.0 minpoll 4 maxpoll 5

fudge 127.127.1.0 stratum 2

3.       重启服务:service ntpd restart

再运行

root@monitor:/etc#ntpdate -q 127.0.0.1

得到

server127.0.0.1, stratum 3, offset -0.000003, delay 0.02565

23 Sep 17:12:00ntpdate[11502]: adjust time server 127.0.0.1 offset -0.000003 s

4.将其他节点的时间与 hadoopmaster同步

配置从节点:

driftfile/var/lib/ntp/drift

restrict127.0.0.1

restrict -6 ::1

restrictdefault kod nomodify notrap nopeer noquery

restrict -6default kod nomodify notrap nopeer noquery #这里是主节点的主机名或者ip server n1 includefile /etc/ntp/crypto/pw

keys/etc/ntp/keys

 


在其他每一个节点运行命令

 ntpdate –u hadoopmaster

 启动服务:serviece ntpd start

参考:http://www.cnblogs.com/jasondan/p/4011153.html

http://jerrylead.iteye.com/blog/1179492

http://www.aboutyun.com/thread-11395-1-1.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值