Hbase集群模式搭建

1.官网下载hbase安装包

这里不做赘述。

2.解压---直接tar -zxvf xxxx

3.配置hbase集群,要修改3个文件(首先zk集群已经安装好了)
注意:要把hadoop的hdfs-site.xml和core-site.xml 放到hbase/conf下

3.1修改hbase-env.sh
export JAVA_HOME=/usr/java/jdk1.8
//告诉hbase使用外部的zk
export HBASE_MANAGES_ZK=false

vim hbase-site.xml




hbase.rootdir
hdfs://ns1/hbase



hbase.cluster.distributed
true



hbase.zookeeper.quorum
itcast04:2181,itcast05:2181,itcast06:2181

vim regionservers

itcast03
itcast04
itcast05
itcast06

3.2拷贝hbase到其他节点

scp -r /itcast/hbase-0.96.2-hadoop2/ itcast02:/itcast/
scp -r /itcast/hbase-0.96.2-hadoop2/ itcast03:/itcast/
scp -r /itcast/hbase-0.96.2-hadoop2/ itcast04:/itcast/
scp -r /itcast/hbase-0.96.2-hadoop2/ itcast05:/itcast/
scp -r /itcast/hbase-0.96.2-hadoop2/ itcast06:/itcast/

4.将配置好的HBase拷贝到每一个节点并同步时间。

5.启动所有的hbase
分别启动zk
./zkServer.sh start
启动hbase集群
start-dfs.sh
启动hbase,在主节点上运行:
start-hbase.sh
6.通过浏览器访问hbase管理页面
192.168.1.133:60010
7.为保证集群的可靠性,要启动多个HMaster
hbase-daemon.sh start master
Hmaster不启动
hbase-site.xml增加配置


hbase.unsafe.stream.capability.enforce
false

8.启动异常:

java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of 'hbase.procedure.store.wal.use.hsync' to set the desired level of robustness and ensure the config value of 'hbase.wal.dir' points to a FileSystem mount that can provide it.

hbase-site.xml增加配置 


hbase.unsafe.stream.capability.enforce
false

9.idea javaapi 连接本地hbase超时

hbase-site.xml增加配置


hbase.master.ipc.address
0.0.0.0


hbase.regionserver.ipc.address
0.0.0.0

 

转载于:https://www.cnblogs.com/jake-jin/p/11435291.html

你可能感兴趣的:(Hbase集群模式搭建)