HBase集群搭建
准备工作
需要先安装好Zookeeper集群和Hadoop集群
Zookeeper集群启动
./bin/zkServer.sh start ./bin/zkServer.sh start ./bin/zkServer.sh start
Hadoop集群启动
./sbin/start-dfs.sh ./sbin/start-yarn.sh
HBase集群搭建
HBase解压
//选择master节点 sudo tar -zxvf hbase-1.3.1-bin.tar.gz -C /usr/local/
配置文件
hbase-env.sh
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_162 //使用外部的zookeeper,不用自带的 export HBASE_MANAGES_ZK=false
hbase-site.xml
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://slave1:9000/HBase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.master.port</name> <value>16000</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>master,slave1,slave2</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/usr/local/zookeeper/zkData</value> </property> </configuration>
regionservers
master slave1 slave2
将hadoop的hdfs-site.xml和core-site.xml配置文件软连接到HBase中,或者复制到HBase/conf下
ln -s /usr/local/hadoop/etc/hadoop/core-site.xml /usr/local/hbase/conf/core-site.xml ln -s /usr/local/hadoop/etc/hadoop/hdfs-site.xml /usr/local/hbase/conf/hdfs-site.xml
将hbase目录发送给其他节点
sudo scp -r ./hbase/ :/usr/local/ sudo scp -r ./hbase/ :/usr/local/
HBase集群启动
./bin/start-hbase.sh
如果出现下面问题,是zookeeper没有文件写入权限的原因。将zookeeper目录权限改为可写入。
ERROR: Can‘t get master address from ZooKeeper; znode data == null
相关推荐
晨曦之星 2020-08-14
lwb 2020-07-26
eternityzzy 2020-07-19
大而话之BigData 2020-06-16
ITwangnengjie 2020-06-14
gengwx00 2020-06-11
大而话之BigData 2020-06-10
鲸鱼写程序 2020-06-08
needyit 2020-06-04
strongyoung 2020-06-04
WeiHHH 2020-05-30
ITwangnengjie 2020-05-09
gengwx00 2020-05-08
gengwx00 2020-05-09
大而话之BigData 2020-05-06
Buerzhu 2020-05-01
gengwx00 2020-04-30