Configuring the HBase database on Hadoop

Source: Internet
Author: User

An existing environment:

1. ubuntu:14.04.2

2.jdk:1.8.0_45

3.hadoop:2.6.0

4.hbase:1.0.0

Detailed process:

1. Download the latest hbase, here i download the hbase-1.0.0 version, then open the terminal, enter: Tar zxvf Hbase-1.0.0.tar.gz unzip, and then put HBase under the appropriate path (either the user directory or the root directory, it is not clear whether it must be placed in a root directory with Hadoop, I am in the same directory)

2. Modify 2 configuration files (this is pseudo-distributed, stand-alone version no longer described)

    • Hbase-env.sh (in the Conf folder in the installation directory of HBase)
Export java_home=/usr/lib/jvm/javaexport hbase_manages_zk=true// Open Comments and configure the JAVA environment 
    • Hbase-site.xml
//Add the following configuration information:<property> <name>hbase.rootdir</name> <value>hdfs://localhost:8020/hbase</value>//the path here must be consistent with the Fs.default.name in Hadoop's core-site.xml, and there is a need to be aware of the port number 8020, which is 9000 by default. My setup failed to start hbase successfully at 9000, and when I switched to 8020, it started successfully .</property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>dfs.replication</name> &LT;VALUE&G T1</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/server1/Documents/zookeeper</value>//set the place where HBase stores zookeeper files</property>

3. Start Hadoop.

4. Start HBase. Into the bin, enter the command:./start-hbase.sh

13808 Jps 12880 Hquorumpeer 13044 Hregionserver 12948 hmaster   //12105  secondarynamenode11913 DataNode 11758 NameNode

5. Enter the shell mode in the terminal input bin/hbase shell.

6. To create a table in Shell mode:

Create'Test','CF'   //Create a table named ' Test ' containing a column family ' CF 'Describe'Test'   //listing the details of a tablePut'Test','Row1','cf:a','value1'   //insert a row of data into the table,
Row1 is a unique identity, CF contains a column named A, and its value is value1

7. Close HBase and Hadoop

8. Possible problems and solutions:

    • An issue that hbase cannot start.
      • There are many reasons why hbase could not be started because I was too fortunate to have encountered O (∩_∩) in all kinds of problems o~
      • One, after starting hbase, there is no hmaster.
      • Second, after the start of HBase, Hmaster flash back.
      • Third, a null pointer error is generated when the table is built.
      • Four, HBase cannot start.
    • Solution:
      • There are several ways to search for various solutions on the network:
        • Modify Hbase-site.xml, add various configuration information;
        • Modify the etc/hosts to remove the IP that corresponds to Ubuntu;
        • Modify Etc/profile, configure environment variables for hbase (similar to JDK configuration);
        • Copy the Core-site.xml and Hadoop-core-xxx.jar in Hadoop to the appropriate directory in HBase (because I'm installing the hadoop-2.6.0 version, I haven't found the Hadoop-core jar file for half a day, Then Google, said that 2.x or more versions do not have these jar files, not to use the words can only be downloaded from the official website;
      • Your own solution:
        • The real reason is that hadoop,hbase is incompatible with the JDK version, which causes all of the above problems, including the flashback, the inability to start, and so on. The last solution is to solve the incompatibility problem. Since my own first use of HADOOP-2.6.0,JDK is 1.8.x,hbase is 0.8.27. The essential reason is that the hbase version is too low and the JDK version is too high. The simplest scenario is to remove the lower version of HBase, and then install the latest high-version hbase, which can be easily resolved.

      

Summary: Version inconsistency will lead to compatibility issues, need to configure a variety of information, so in the future to see the textbook or someone else's blog is the version of the file, and then installed, standing on the shoulders of giants, to go farther!!

Configuring the HBase database on Hadoop

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.