HBase series (three) - HBase basic environment to build

First, the installation instructions preconditions

1.1 JDK Release Notes

HBase need to rely on JDK environment, while HBase 2.0+ or ​​later no longer supports JDK 1.7, you need to install JDK 1.8+. JDK installation see this warehouse:

Linux environment JDK installation

1.2 Standalone mode and the difference between pseudo-cluster model

  • In the Standalonemode, all daemons are running in a jvmprocess / instance;
  • , HBase still running on a single host in a pseudo-distribution pattern, but each daemon (HMaster, HRegionServer and the ZooKeeper) respectively as a separate process.

Description: choose one of two modes can be deployed for development and testing is not very different.

Two, Standalone mode

2.1 Download and unzip

From the official website you need to download the binary version of the installation package and decompress:

# tar -zxvf hbase-2.1.4-bin.tar.gz

2.2 Configuration Environment Variables

# vim /etc/profile

Add environment variables:

export HBASE_HOME=/usr/app/hbase-2.1.4
export PATH=$HBASE_HOME/bin:$PATH

Making the environment variable configuration to take effect:

# source /etc/profile

2.3 Related performed HBase

Modifying the installation directory conf/hbase-env.sh, specify JDK installation:

# The java implementation to use.  Java 1.8+ required.
export JAVA_HOME=/usr/java/jdk1.8.0_201

Modifying the installation directory conf/hbase-site.xml, add the following configuration:

<configuration>
 <property>
    <name>hbase.rootdir</name>
    <value>file:///home/hbase/rootdir</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/zookeeper/dataDir</value>
  </property>
  <property>
    <name>hbase.unsafe.stream.capability.enforce</name>
    <value>false</value>
  </property>
</configuration>

hbase.rootdir: Hbase configuration data storage path;

hbase.zookeeper.property.dataDir: Zookeeper configuration data storage path;

hbase.unsafe.stream.capability.enforce: Using a local file system storage, without the use of HDFS need to disable this configuration, set to false.

2.4 start HBase

Since you have to HBase bin directory configuration environment variable, direct start using the following command:

# start-hbase.sh

2.5 verify the success of start

A verification method: Use the jpscommand to view HMaster process is started.

[root@hadoop001 hbase-2.1.4]# jps
16336 Jps
15500 HMaster

Verify way: access HBaseWeb UI page, the default port 16010.

Third, the pseudo trunked mode installation (Pseudo-Distributed)

3.1 Hadoop pseudo single cluster installation

Here we use HDFS as HBase storage solutions need to pre-install Hadoop. Hadoop installation to finish alone:

Hadoop Cluster Setup standalone pseudo

Select version 3.2 Hbase

HBase version must be compatible with the version of Hadoop, otherwise there will be a variety of Jar package conflicts. Here I Hadoop version is installed hadoop-2.6.0-cdh5.15.2, in order to maintain a consistent version, select the version of HBase hbase-1.2.0-cdh5.15.2. All software versions are as follows:

  • Hadoop version: hadoop-2.6.0-cdh5.15.2
  • HBase version: hbase-1.2.0-cdh5.15.2
  • JDK versions: JDK 1.8

3.3 software download, unzip

Decompress after download, download address: http: //archive.cloudera.com/cdh5/cdh/5/

# tar -zxvf hbase-1.2.0-cdh5.15.2.tar.gz

3.4 Configuration Environment Variables

# vim /etc/profile

Add environment variables:

export HBASE_HOME=/usr/app/hbase-1.2.0-cdh5.15.2
export PATH=$HBASE_HOME/bin:$PATH

Making the environment variable configuration to take effect:

# source /etc/profile

3.5 conduct HBase configuration

1. Modify the installation directory conf/hbase-env.sh, specify JDK installation:

# The java implementation to use.  Java 1.7+ required.
export JAVA_HOME=/usr/java/jdk1.8.0_201

2. Modify the installation directory conf/hbase-site.xml, add the following configuration (hadoop001 host name):

<configuration>
 <!--指定 HBase 以分布式模式运行-->   
 <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
 </property>
 <!--指定 HBase 数据存储路径为 HDFS 上的 hbase 目录,hbase 目录不需要预先创建,程序会自动创建-->   
 <property>
    <name>hbase.rootdir</name>
    <value>hdfs://hadoop001:8020/hbase</value>
  </property>
    <!--指定 zookeeper 数据的存储位置-->   
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/zookeeper/dataDir</value>
  </property>
</configuration>

3. Modify the installation directory conf/regionservers, specified address region servers after modifying its contents as follows:

hadoop001

3.6 start

# bin/start-hbase.sh

3.7 verify the success of start

A verification method: Use the jpscommand to view the process. Which HMaster, HRegionServerit is HBase process, HQuorumPeeris the built-in process Zookeeper's HBase, HDFS and for the rest of YARN process.

[root@hadoop001 conf]# jps
28688 NodeManager
25824 GradleDaemon
10177 Jps
22083 HRegionServer
20534 DataNode
20807 SecondaryNameNode
18744 Main
20411 NameNode
21851 HQuorumPeer
28573 ResourceManager
21933 HMaster

Verify way: access HBase Web UI interface, to note that access version 1.2 port for the HBase 60010

More big data series can be found GitHub open source project : Big Data Getting Started

Guess you like

Origin www.cnblogs.com/heibaiying/p/11404876.html