gengwx00 2020-04-16
需要先安装好Zookeeper集群和Hadoop集群
./bin/zkServer.sh start ./bin/zkServer.sh start ./bin/zkServer.sh start
./sbin/start-dfs.sh ./sbin/start-yarn.sh
//选择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
sudo scp -r ./hbase/ :/usr/local/ sudo scp -r ./hbase/ :/usr/local/
./bin/start-hbase.sh
如果出现下面问题,是zookeeper没有文件写入权限的原因。将zookeeper目录权限改为可写入。
ERROR: Can‘t get master address from ZooKeeper; znode data == null