大数据之Hbase环境安装

发布于:2024-12-22 ⋅ 阅读:(11) ⋅ 点赞:(0)

Hbase软件版本下载地址:

http://mirror.bit.edu.cn/apache/hbase/

1. 集群环境

Master 172.16.11.97

Slave1 172.16.11.98

Slave2 172.16.11.99

2. 下载软件包

#Master

wget http://archive.apache.org/dist/hbase/0.98.24/hbase-0.98.24-hadoop1-bin.tar.gz

tar zxvf hbase-0.98.24-hadoop1-bin.tar.gz

3. 修改Hbase配置

#Master

cd hbase-0.98.24-hadoop1/conf

vim regionservers

master

slave1

slave2

vim hbase-env.sh

export JAVA_HOME=/usr/local/src/jdk1.8.0_152

export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib

vim hbase-site.xml

<configuration>
        <property>
                <name>hbase.tmp.dir</name>
                <value>/var/hbase</value>
        </property>
        <property>
                <name>hbase.rootdir</name>
                <value>hdfs://master:9000/hbase</value>
        </property>
        <property>
                <name>hbase.cluster.distributed</name>
                <value>true</value>
        </property>
        <property>
                <name>hbase.zookeeper.quorum</name>
                <value>master,slave1,slave2</value>
        </property>
        <property>
                <name>hbase.zookeeper.property.dataDir</name>
                <value>/usr/local/src/hbase-0.98.24-hadoop1/zookeeper</value>
        </property>
        <property>
                <name>hbase.master.info.port</name>
                <value>60010</value>
        </property> 
</configuration>

4. 增加环境变量

#Master、Slave1、Slave2

vim ~/.bashrc

HBASE_HOME=/usr/local/src/hbase-0.98.24-hadoop1

HBASE_CLASSPATH=$HBASE_HOME/conf

HBASE_LOG_DIR=$HBASE_HOME/logs

PATH=$PATH:$HBASE_HOME/bin

#刷新环境变量

source ~/.bashrc

5. 拷贝安装包

#Master

scp -r /usr/local/src/hbase-0.98.24-hadoop1 root@slave1:/usr/local/src/hbase-0.98.24-hadoop1

scp -r /usr/local/src/hbase-0.98.24-hadoop1 root@slave2:/usr/local/src/hbase-0.98.24-hadoop1

6. 启动集群

#Master

bin/start-hbase.sh

7. 进程状态

8. 监控页面

http://master:60010/master-status

9. 关闭集群

#master

stop-hbase.sh