伪分布式配置HBase

    xiaoxiao2022-07-06  222

    注:为分布式下配置HBase

    1.官网下载HBase1.4.9版本的bin压缩包,针对hadoop2.0的用户,如果下载2.0以上的HBase,会出错。

    2.上传到虚拟机,解压。

    tar -zxvf hbase-1.4.9-bin.tar.gz

    3.进入hbase的conf目录,修改hbase-site.xml文件

    1.vim hbase-site.xml 2.将configuration替换成如下代码 <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://192.168.159.100:9000/hbase</value> <!--hdfs://虚拟机地址:端口号/存放目录--> </property> <!--hbase中的数据存储在hdfs上的hbase目录里--> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/testuser/zookeeper</value> </property> <!--zookeeper存放数据的目录--> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>true</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> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration>

    4.添加环境变量

    1.vim /etc/profile 2.添加: export HBASE_HOME=/root/tools/hbase export PATH=$PATH:$HBASE_HOME/bin

    5.source /etc/profile

    6.进入conf/hbase-evn.sh,添加JDK安装路径

    export JAVA_HOME=/usr/jdk64/jdk1.8.0_112

    7.启动hbase

    start-hbase.sh

    8.jps查看是否存在:HQuorumPeer(zookeeper),Hmaster,HRegionServer 存在则成功 9.hbase shell进入hbase数据库

    最新回复(0)