1.hbase安装注意事项
hbase开始安装前确保安装了zookeeper、java、hadoop
以及hadoop版本号对应的hbse版本。以免发生不兼容现象。安装时一定要同步ntp时间
2.ntp同步liunx集群时间
(1)选择其中一台作为基准服务器,安装ntp
机器mini1,mini2,mini3
yum install ntp
(2)服务器配置
mini1上调整时间
可以联网的情况下执行命令,确保mini1上的时间与本地时间保持一致
ntpdate 0.centos.pool.ntp.org #该网址为centos网络上的时间同步服务器
一般情况下,我们的集群为内网环境,无法和外网进行联网同步之间,那么手动执行命令调整时间
date -s '2008-05-23 01:01:01' + '%F %T' #2008-05-23 01:01:01为将要设定的时间
host1上修改配置文件/etc/ntp.conf
vi /etc/ntp.conf
添加下面两行,表示将本地的硬件时间也作为同步的时间源之一,这样在不联网的时候可以把本机时间作为同步时间源, 在内网环境下,可以把配置文件中其他的server都删除掉。
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
如果集群是在一个封闭的局域网内,可以屏蔽掉默认的server:
#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
host1上配置客户端的授权
restrict 192.168.71.221 mask 255.255.255.250 nomodify notrap
也就是给指定的机器(客户端)设置访问NTP Server的权限,这是通过restrict配置项实现的,以下是它的格式说明。
其中parameter的参数主要有:
ignore : 拒绝所有类型的ntp连接
nomodify : 客户端不能使用ntpc与ntpq两支程式来修改服务器的时间参数
noquery : 客户端不能使用ntpq、ntpc等指令来查询服务器时间,等于不提供ntp的网络校时
notrap : 不提供trap这个远程时间登录的功能
notrust : 拒绝没有认证的客户端
nopeer : 不与其他同一层的ntp服务器进行时间同步
(3)客户机配置
mini2,mini3上修改配置文件/etc/ntp.conf
vi /etc/ntp.conf
删除其他的server 开头的配置项,这里一定要删除,只同步我们配置的那台服务器,添加上面设置的NTP服务器地址
server mini1
查看与时间同步服务器的时间偏差
ntpdc -c loopinfo
查看当前同步的时间服务器,查看没问题就安装成功了
ntpq -p
(4)启动ntp服务
service ntpd start #启动ntpd时间服务器
chkconfig ntpd on #开机自启动
3.hbase配置
(1)hbase-env.sh环境变量配置
#!/usr/bin/env bash
#
#/**
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you