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


2、安装时间服务器

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

yum -y install ntp
chkconfig --add ntpd
chkconfig ntpd on

  • 编辑ntp配置文件:

cp /etc/ntp.conf /etc/ntp.conf.bak
vi /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 nomodify
restrict 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.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org
server 3.cn.pool.ntp.org

保存退出。

  • server1执行时间更新:

ntpdate 0.rhel.pool.ntp.org

  • 在server1上启动ntp服务:

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

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

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

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

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

相关内容