HBase 单机版安装启动
最近在做GeoMesa的开发,所以搭建了一个单机版HBase(即 Master, RegionServers, and ZooKeeper 运行在同一个java虚拟机)。因为只是开发阶段用,所以性能容灾等等都不用考虑,单机版是最方便。下面是安装流程。
1. 下载并解压HBase安装包
# 解压到需要安装的目录(我放在/home/local) tar -zxvf hbase-1.4.11-bin.tar.gz
2. 修改HBase配置文件
进入hbase conf 目录,修改hbase环境变量配置文件hbase-env.sh。
# 找到并修改JAVA_HOME地址 export JAVA_HOME=/home/local/jdk1.8.0_231/ # 注释掉PermSize的配置,JDK1.8之后会导致启动提示warning # Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+ #export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m" #export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m"
修改conf目录下hbase-site.xml配置,指定hbase和zookeeper存储目录。
<configuration> <property> <name>hbase.rootdir</name> <value>file:///home/local/data/hbase</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/local/data/zookeeper</value> </property> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> <description> Controls whether HBase will check for stream capabilities (hflush/hsync). Disable this if you intend to run on LocalFileSystem, denoted by a rootdir with the 'file://' scheme, but be mindful of the NOTE below. WARNING: Setting this to false blinds you to potential data loss and inconsistent system state in the event of process and/or node failures. If HBase is complaining of an inability to use hsync or hflush it's most likely not a false positive. </description> </property> </configuration>
3. 启动HBase
进入bin目录执行 启动命名,检查是否启动成功。
sh start-hbase.sh
4. 配置HBase环境变量,方便使用shell命令
# 编辑/etc/profile文件,增加HBase配置 vim /etc/profile # 增加以下配置 # hbase export HBASE_HOME=/home/local/hbase-1.4.11 export PATH=$PATH:$HBASE_HOME/bin