I. Environment construction

Use CentOS7 system, first delete the JDK, built-in is not easy to use (such as JPS terminal command can not use). Download the full JDK from the official website and set the environment variable JAVA_HOME. See:

Blog.csdn.net/libaineu200… \

\

Download the stable haBSE version 1.2.6

Mirror.bit.edu.cn/apache/hbas… \

Decompress tar -xzvf hbase-1.2.6-bin.tar.gz. The author works in /root/downloads /hbase-1.2.6/

\

Three, configuration,

1. In single-machine mode, the ZooKeeper program and HBase program run in the same JVM process.

Hbase relies on ZooKeeper. All nodes and clients must be able to access ZooKeeper. The HBase installation package contains ZooKeeper. The conf/hbase-env.sh file defines environment variables:

# export HBASE_MANAGES_ZK=true\

It is used to set whether HBase uses the default Zookeeper or an independent Zookeeper.

Independent if HBASE_MANAGES_ZK is false.

If HBASE_MANAGES_ZK is true, the default ZooKeeper is used. That is, the default ZooKeeper is started when Hbase is started.

If you use zooKeeper, the effect is the same with or without this line of environment variable comments. The default value is true.

In other words, the conf/hbase-env.sh file does not need to be modified.

But I personally recommend that it be more intuitive to remove the comments and make JAVA_HOME explicit again. (Optional)

Export JAVA_HOME = / root/Downloads/jdk1.8.0 _172 \

export HBASE_LOG_DIR=/usr/local/hbase/logs\

export HBASE_MANAGES_ZK=true\

2. In single-machine deployment mode, HBase uses only local file systems instead of HDFS. You do not need to modify the conf/hbase-env.sh file. You only need to modify the conf/hbase-site. XML file to specify the path for storing the data file.

<configuration>
   <property>
      <name>hbase.tmp.dir</name>
      <value>/usr/local/hbase/hbaseData</value>
   </property>
    <property>
        <name>hbase.rootdir</name>
        <value>file:/usr/local/hbase</value>
    </property>
</configuration>
Copy the code

\

Note:

(1) HBase can be deployed using common file systems to store data in single-machine deployment mode without relying on the HDFS of Hadoop. Note HBase can leave the HDFS.

(2) If you do not modify the conf/hbase-site. XML file, hbase is written to/TMP by default. / TMP will be cleared during the restart and data will be lost.

\

For terminal verification, go to /root/downloads /hbase-1.2.6/bin

[root@bogon bin]# echo $JAVA_HOME /root/downloads/jdk1.8.0_172 [root@bogon bin]#./start-hbase.sh Starting master, Logging to/root/Downloads/hbase – 1.2.6 / bin /.. /logs/hbase-root-master-bogon.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 [root@bogon bin]# JPS 98741 JPS 98382 HMaster [root@bogon bin]# hbase Shell 2018-04-27 09:34:39,017 WARN [main] util.NativeCodeLoader: Unable to load native Hadoop Library for your platform… using builtin-java classes where applicable HBase Shell; Enter ‘help

‘ for list of supported commands. Type “exit

” to leave the HBase Shell Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017 hbase(main):001:0> list TABLE 0 row(s) in 0.2190 seconds => [] hbase(main):002:0> create ‘user’,’ PersonalInfo ‘0 row(s) in 1.3250 seconds => Hbase:: table-user Hbase (main):003:0> list Table user 1 row(s) in 0.0460 seconds = > \ [” user “]

hbase(main):004:0> 

hbase(main):001:0> exit\

\

5. The ZooKeeper program and HBase program run in the same JVM process. If you run the JPS command, you can only see HMaster.

[root@bogon bin]# netstat -tunlp|egrep 2181

tcp6       0      0 :::2181                 :::*                    LISTEN      5804/java   \

\

Six, web monitoring, open the browser

http://localhost:16010/master-status

或者

http://192.168.83.128:16010/master-status\

\

Reference: blog.csdn.net/lisonglison…

\

—-

About JPS terminal commands:

JPS is a tool provided by Java to view Java processes. For example, if I run the JPS command to view Java processes, the following information is normally displayed: < process number 1111>…… < process name A> < Process number 2222>…… < process name B> < Process number 3333>…… < process name C> < Process number 4444>……

\

In this case, you can kill the process with kill -9 < process number >.

\