HBase——2.单机安装

1. 下载二进制文件

[root@node1 soft]# wget https://mirror.bit.edu.cn/apache/hbase/hbase-1.3.6/hbase-1.3.6-bin.tar.gz
[root@node1 soft]# tar xvf hbase-1.3.6-bin.tar.gz

2. 准备安装环境

[root@node1 soft]# mkdir /share/hbase /data/hbase /data/hbase/zookeeper -pv
[root@node1 soft]# mv hbase-1.3.6 /share/hbase/ 
[root@node1 soft]# cd /share/hbase/hbase-1.3.6/
[root@node1 hbase-1.3.6]#  mkdir /share/lnhome -pv
[root@node1 hbase-1.3.6]#  ln -sf  /share/hbase/hbase-1.3.6/ /share/lnhome/hbase
root@node1 hbase-1.3.6]# cd conf/
[root@node1 conf]# ls
hadoop-metrics2-hbase.properties  hbase-env.sh      hbase-site.xml          log4j.properties
hbase-env.cmd                     hbase-policy.xml  log4j-hbtop.properties  regionservers

3. 修改配置文件

[root@node1 conf]# cp hbase-site.xml hbase-site.xml.bak
[root@node1 conf]# cp hbase-env.sh hbase-env.sh.bak
[root@node1 conf]# vim hbase-env.sh
export JAVA_HOME=$JAVA_HOME 
export HBASE_MANAGES_ZK=true
[root@node1 conf]# pwd
/share/lnhome/hbase/conf
[root@node1 conf]# vim hbase-site.xml
        <property>
                <name>hbase.rootdir</name>
                <value>file:///data/hbase</value>
                <description>hbase存放数据目录 
                hbase.rootdir默认为/tmp/hbase-${user.name},这意味着每次重启系统都会丢失数据。</description>
        </property>

        <property>
                <name>hbase.zookeeper.property.dataDir</name>
                <value>/data/hbase/zookeeper</value>
                <description>ZooKeeper数据文件路径</description>
        </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>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2182</value>
</property>
</configuration>

4. 生成环境变量

[root@node1 conf]# vim /etc/profile
export HBASE_HOME=/share/lnhome/hbase 
export PATH=$HBASE_HOME/bin:$PATH
[root@node1 conf]# vim ~/.bashrc 
export HBASE_HOME=/share/lnhome/hbase 
export PATH=$HBASE_HOME/bin:$PATH
[root@node1 conf]# source /etc/profile ~/.bashrc

5. 启动测试

[root@node1 logs]# start-hbase.sh 
starting master, logging to /share/lnhome/hbase/logs/hbase-root-master-node1.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/share/hbase/hbase-1.3.6/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/share/hadoop/hadoop-2.7.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[root@node1 logs]# jps
73027 NodeManager
73331 ResourceManager
74034 DFSZKFailoverController
74343 NameNode
20135 QuorumPeerMain
73945 JournalNode
73868 DataNode
76556 HMaster
76830 Jps
[root@node1 logs]# start-hbase.sh status
master running as process 76556. Stop it first.

http://node1:16010/HBase——2.单机安装_第1张图片***————Blueicex 2020/3/12 21:05 [email protected]***

你可能感兴趣的:(HBase,hbase)