HBase (Distributed database) installation configuration for Hadoop series

Source: Internet
Author: User
Tags zookeeper

 <configuration>      <property>           <name>hbase.rootdir</name>r           <value>hdfs://hdfs-master:9000/hbase</value>          //must be consistent with your Hadoop hostname and port number; HBase This item does not recognize the machine IP and can only be used with machine hostname     </ property>      <property>           <name>hbase.cluster.distributed</name>           <value>true</value>      </property>       <property>          < name>hbase.zookeeper.quorum</name>          < Value>hdfs-master,hdfs-slave1,hdfs-slave2</value>    </property>       <property>          <name>hbase.master</name >          <value>192.168.3.10:60000</value>       </property>      <property>           <name>zookeeper.session.timeout</name>           <value>60000</value>       </property>      <property>           <name>hbase.zookeeper.property.clientPort</name>           <value>2222</value>       </property&gT;    </configuration> 

#vim regionservers (Add all Datanode host names here)
Hdfs-slave1
Hdfs-slave2
4. Distributing files to other Datanode nodes on the cluster
Scp-r/usr/local/hadoop/hbase [Email protected]:/usr/local/hadoop/
Scp-r/usr/local/hadoop/hbase [Email protected]:/usr/local/hadoop/
5. Start HBase in Namenode:
/usr/local/hadoop/hbase/bin/start-hbase.sh
View in Namenode with JPS command
[[email protected] soft]# JPS
10546 Jps
2282 Secondarynamenode
10040 Hquorumpeer
10124 Hmaster
2127 NameNode
2437 ResourceManager
On Datanode, use the JPS command to view
[Email protected] hadoop]# JPS
836 DataNode
3140 Hregionserver
3329 Jps
3028 Hquorumpeer
6. Test HBase functionality
HBase Shell
6.1 Displaying data tables and creating student tables (with Name and address fields)
HBase (main):015:0> list
TABLE
0 row (s) in 0.0220 seconds
= []
HBase (main):016:0> create ' student ', ' name ', ' address '
0 row (s) in 0.4350 seconds
= Hbase::table-student
6.2 Insert a record and insert only one column
HBase (main):017:0> put ' student ', ' 1 ', ' name ', ' Tom '
0 row (s) in 0.2500 seconds
6.3. Query a record based on row value
HBase (main):018:0> get ' student ', ' 1 '
COLUMN CELL
name:timestamp=1411002916692, Value=tom
1 row (s) in 0.0260 seconds
6.4. Insert a family address to the student's address cluster
HBase (main):019:0> put ' student ', ' 1 ', ' address:home ', ' Shenzhen Street '
0 row (s) in 0.0180 seconds
6.5 Check the student's home address
HBase (main):020:0> get ' student ', ' 1 ',{column=> ' address:home '}
COLUMN CELL
Address:home timestamp=1411003134400, Value=shenzhen Street
1 row (s) in 0.0250 seconds
6.6 Delete data table (need to disable ' table name first ')
HBase (Main):023:0> disable "student"
0 row (s) in 1.3480 seconds
HBase (Main):024:0> drop "student"
0 row (s) in 0.2060 seconds
HBase (main):025:0> list
TABLE
0 row (s) in 0.0210 seconds
= []
7.WEB page to manage the view HBase database.
hmaster:http://192.168.3.10:60010/master.jsp

This article is from the "Chengdu @ Ah-like" blog, please be sure to keep this source http://azhuang.blog.51cto.com/9176790/1554596

HBase (Distributed database) installation configuration for Hadoop series

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.