centos部署HBase


1,三台机器安装zookeeper

参考:
Hbase安装配置(含分布式ZooKeeper)
部署与管理ZooKeeper(转)


1.下载:

wget http://apache.stu.edu.tw/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz

2.解压到/usr/local/zookeeper

chown -R hadoop:hadoop /usr/local/zookeeper

3.创建数据目录

chown -R hadoop:hadoop /data/zookeeper

4.做zookeeper软连接(在hadoop用户下)

ln -s /usr/local/zookeeper zookeeper

5.在zookeeper/conf中

cp zoo_sample.cfg zoo.cfg

6.编辑配置文件zoo.cfg

vi zoo.cfg
# 修改数据目录dataDir为以下值  
dataDir=/data/zookeeper  

# 添加以下段落  
server.1=datanode1:2888:3888
server.2=datanode2:2888:3888
server.3=namenode:2888:3888

7.在每个节点的数据目录下的myid文件里写上id
8. 配置环境变量并启动ZooKeeper

#配置
vi .bashrc  
export ZOOKEEPER_HOME=/usr/local/zookeeper  
PATH=$PATH:$ZOOKEEPER_HOME/bin 

#启动
zkServer.sh start

9.所有机器都启动好后验证

echo stat|nc localhost 2181

若出现

Zookeeper version: 3.4.9-1757313, built on 08/23/2016 06:50 GMT
Clients:
 /0:0:0:0:0:0:0:1:35936[0](queued=0,recved=1,sent=0)

Latency min/avg/max: 0/0/0
Received: 1
Sent: 0
Connections: 1
Outstanding: 0
Zxid: 0x100000000
Mode: follower
Node count: 4

10.zookeeper配置完成!



2.安装HBase


1.下载

wget http://apache.stu.edu.tw/hbase/stable/hbase-1.2.4-bin.tar.gz

2.解压到 /usr/local/hbase

chown -R hadoop:hadoop /usr/local/hbase

3.设置软连接(在hadoop用户下)

ln -s /usr/local/hbase hbase

4.修改配置文件
hbase-site.xml

<configuration>
    <property>  
        <name>hbase.rootdirname>  
        <value>hdfs://namenode:9000/hbasevalue>  
    property>  

    <property>  
        <name>hbase.cluster.distributedname>  
        <value>truevalue>  
    property>  

    <property>  
        <name>hbase.zookeeper.quorumname>  
        <value>namenode,datanode1,datanode2value>  
    property>  

    <property>  
        <name>zookeeper.session.timeoutname>  
        <value>60000value>  
    property>  

    <property>  
        <name>hbase.zookeeper.property.clientPortname>  
        <value>2181value>  
    property> 
configuration>

hbase-evn.sh

#修改java_home
export JAVA_HOME=${JAVA_HOME}
#使用自定义的zk
export HBASE_MANAGES_ZK=false

.bashrc

#添加hbase环境变量

5.启动

start-hbase.sh

你可能感兴趣的:(大数据)