集群机器时间同步

使用ntp配置内网中集群机器时间同步
集群的时间要同步
	找一台集群
      时间服务器
	所有的机器与这台机器时间进行定时的同步
	  比如,每日十分钟,同步一次时间
step1: 检查时间服务器有没有装ntp
[xiangkun@hadoop-senior01 hadoop-2.5.0]$ rpm -qa|grep ntp

ntp-4.2.6p5-1.el6.centos.x86_64
fontpackages-filesystem-1.41-1.1.el6.noarch
ntpdate-4.2.6p5-1.el6.centos.x86_64
step2:

ntp.conf 修改三处:


xiangkun@hadoop-senior01 /]$ vi /etc/ntp.conf



#####################第一处:注释打开,修改网段#######
restrict 192.168.111.0 mask 255.255.255.0 nomodify 
##################################################


#####################第二处:注释##################
#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  #local clock
fudge 127.127.1.0 stratum 10y the key identifier to use with the ntpq utility.
#controlkey 8
##################################################




####编辑/etc/sysconfig/ntpd

[xiangkun@hadoop-senior01 ~]$ sudo vi /etc/sysconfig/ntpd
[sudo] password for xiangkun: 
#########增加##############
SYNC_HWCLOCK=yes
##########################
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
启动ntpd
[root@hadoop-senior01 xiangkun]# service ntpd status
ntpd 已停
[root@hadoop-senior01 xiangkun]# service ntpd start
正在启动 ntpd:[确定]
[root@hadoop-senior01 xiangkun]# service ntpd status
ntpd (pid  5537) 正在运行...
[root@hadoop-senior01 xiangkun]# chkconfig ntpd on
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值