CDH5.3集群安装笔记-环境准备(2)

来源:互联网 发布:java 自定义属性 编辑:程序博客网 时间:2024/05/14 09:32

2、安装时间服务器

  • 在server1.cdhwork.org(192.168.10.1)安装ntp服务,确保服务器可以访问外网:

yum -y install ntpchkconfig --add ntpdchkconfig ntpd on

  • 编辑ntp配置文件:

cp /etc/ntp.conf /etc/ntp.conf.bakvi /etc/ntp.conf
修改如下部分:
# Permit time synchronization with our time source, but do not# permit the source to query or modify the service on this system.# restrict default kod nomodify notrap nopeer noquery# restrict default nomodifyrestrict 192.168.10.0 mask 255.255.255.255 notrust 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.rhel.pool.ntp.orgserver 1.asia.pool.ntp.orgserver 3.asia.pool.ntp.orgserver 3.cn.pool.ntp.org

保存退出。

  • server1执行时间更新:

ntpdate 0.rhel.pool.ntp.org

  • 在server1上启动ntp服务:

service ntpd start
至此server1上的时间服务器安装完成。

  • 下一步需要在所有服务器上执行用下面的命令,更新时间并做一个定时任务,隔一段时间就同步一次时钟。

ntpdate 192.168.10.1echo '*/30 * * * * root /usr/sbin/ntpdate 192.168.10.1' >> /etc/crontabchkconfig crond onservice crond restart
如果碰到
10 Jan 22:03:05 ntpdate[13550]: the NTP socket is in use, exiting
的出错提示,则是因为此台服务器上已经有ntpd进程在运行了,需要执行service ntpd stop 停止ntpd服务。

时间同步是为了保证所有服务器上的时间相同,这是Hbase RegionServer的安装要求,为了方便处理,我们干脆把所有服务器都进行了时钟同步。

服务器环境我们已经基本搞定了,后面我们需要进行软件环境的安装。

0 0
原创粉丝点击