Hbase2.6.2集群部署
配套版本安装:
Hadoop 3.4.1
Zookeeper3.9.3
Hbase2.6.2
前置安装
Linux环境下部署Zookeeper3.9.3(最新版)集群部署-CSDN博客
Linux环境下Hadoop3.4.1(最新版本)集群部署-CSDN博客
一、文件解压
软件下载:
Apache HBase – Apache HBase Downloads
cd /usr/local/soft/ tar -zxvf hbase-2.6.2-bin.tar.gz二、修改启动变量
编辑环境变量
vi /etc/profile环境变量中添加如下内容
export HBASE_HOME=/usr/local/soft/hbase-2.6.2 export PATH=$PATH:$HBASE_HOME/bin保存系统环境变量
source /etc/profile修改hbase变量
cd /usr/local/soft/hbase-2.6.2/conf/ vi hbase-env.sh添加如下内容
export JAVA_HOME=/usr/local/soft/jdk1.8.0_381 export HBASE_MANAGES_ZK=false三、配置文件
配置hbase-site.xml文件 vi hbase-site.xml
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * --> <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://node11:9000/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>node11,node12,node13</value> </property> <property> <name>hbase.master.info.port</name> <value>60010</value> </property> <property> <name>hbase.master.maxclockskew</name> <value>180000</value> <description>Time difference of regionserver from master</description> </property> <property> <name>hbase.coprocessor.abortonerror</name> <value>false</value> </property> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> </property> <property> <name>hbase.wal.provider</name> <value>filesystem</value> </property> </configuration>注意如果使用外部zk, hbase.cluster.distributed需要设置为true
文件regionservers配置改成如下内容:
node12 node13配置备选master节点(可选)
cd /usr/local/soft/hbase-2.6.2/conf/ touch backup-masters在backup-masters文件中添加如下内容
node12四、集群拷贝文件
scp -r /usr/local/soft/hbase-2.6.2 root@node12:/usr/local/soft scp -r /usr/local/soft/hbase-2.6.2 root@node13:/usr/local/soft scp /etc/profile root@node12:/etc/profile scp /etc/profile root@node13:/etc/profile分别进入node12和node13上执行source /etc/profile
五、启动
依次启动 Hadoop、Zookeeper、Hbase(以下皆在hadoop100节点上执行)
Hadoop启动
start-all.shzookeeper启动
zkStart.sh zkStatus.shHbase启动
start-hbase.sh六、检验
node11节点上执行jps
Web端查看:http://node11:60010/master-status
注:master web 默认是不运行的,需在配置文件中配置端口
七、命令操作
HBase shell数据操作汇总_hbase shell 数据库操作-CSDN博客
FAQ:
1、
808 ERROR [RS-EventLoopGroup-1-2] util.NettyFutureUtils: Unexpected error caught when processing netty java.lang.IllegalArgumentException: object is not an instance of declaring class
编辑hbase-site.xml加入下面这段
<property> <name>hbase.wal.provider</name> <value>filesystem</value> </property>解决ERROR [RS-EventLoopGroup-3-2] util.NettyFutureUtils: Unexpected error caught when processing netty-CSDN博客
2、HMaster启动后进程就结束
解决方案:检查配置无误后
删除hdfs和zk内容
hdfs dfs -rm -r /hbasezkCli.sh -server 192.168.1.11:2181 deleteall /hbase