Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

"Hadoop The Definitive Guide" ch12 HBase

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. About the introduction of HBase, http://www.searchtb.com/2011/01/understanding-hbase.html is very good.

HBase-Hadoop Database is a highly reliable, high-performance, column-oriented and scalable distributed storage system. Large-scale structured storage clusters can be built on cheap PC Server by using HBase technology.

HBase is an open source implementation of Google Bigtable, similar to Google Bigtable using GFS as its file storage system and HBase using Hadoop HDFS as its file storage system; Google runs MapReduce to deal with massive data in Bigtable, HBase also uses Hadoop MapReduce to deal with massive data in HBase; Google Bigtable uses Chubby as a collaborative service and HBase uses Zookeeper as its counterpart.

(HBase feels more like a distributed database learned at school.)

2. The installed version of HBase should correspond to the version of Hadoop. The latest hbase-0.94.0 has been installed at the beginning, but the version of Hadoop is hadoop-0.20.203.0. There is always a problem when starting HBase. After downloading hbase-0.90.6 again, it started successfully at one time.

Html code

[ate: / local/nomad2]

> > / local/nomad2/hbase/hbase-0.94.0/bin/start-hbase.sh

Starting master, logging to / local/nomad2/hbase/hbase-0.94.0/bin/../logs/hbase-nomad2-master-ate.out

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/local/nomad2/hbase/hbase-0.94.0/lib/slf4j-log4j12-1.5.8.jarr _ r _ r]

SLF4J: Found binding in [jar:file:/local/nomad2/hadoop/hadoop-0.20.203.0/lib/slf4j-log4j12-1.4.3.jarring _ Binder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

[ate: / local/nomad2] > > / local/nomad2/hbase/hbase-0.94.0/bin/start-hbase.sh starting master Logging to / local/nomad2/hbase/hbase-0.94.0/bin/../logs/hbase-nomad2-master-ate.outSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/local/nomad2/hbase/hbase-0.94.0/lib/slf4j-log4j12-1.5.8.jarbank] SLF4J: Found binding in [jar:file:/local/nomad2/hadoop/hadoop-0.20.203.0/lib/] Slf4j-log4j12-1.4.3. SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

The solution is to remove the lib under hbase.

Html code

> > hbase classpath | tr ":"\ n" | grep-I slf4j

> > hbase classpath | tr ":"\ n" | grep-I slf4j

3. Set environment variabl

Html code

Export HBASE_INSTALL=/local/nomad2/hbase/hbase-0.90.6

Export PATH=$PATH:$HBASE_INSTALL/bin

Export HBASE_INSTALL=/local/nomad2/hbase/hbase-0.90.6export PATH=$PATH:$HBASE_INSTALL/bin

4. Start HBase

Html code

[ate: / local/nomad2/hbase/hbase-0.90.6/bin]

> > start-hbase.sh

Starting master, logging to / local/nomad2/hbase/hbase-0.90.6/bin/../logs/hbase-nomad2-master-ate.out

[ate: / local/nomad2/hbase/hbase-0.90.6/bin]

> > hbase shell

HBase Shell; enter 'help' for list of supported commands.

Type "exit" to leave the HBase Shell

Version 0.90.6, r1295128, Wed Feb 29 14:29:21 UTC 2012

Hbase (main): 001 test', 0 > create 'test',' data'

0 row (s) in 1.4430 seconds

Hbase (main): 002purl 0 > list

TABLE

Test

1 row (s) in 0.0420 seconds

Hbase (main): 003 test', 0 > put 'test',' row1', 'data:1',' value1'

0 row (s) in 0.1500 seconds

Hbase (main): 005 test', 0 > put 'test',' row2', 'data:2',' value2'

0 row (s) in 0.0230 seconds

Hbase (main): 006 test', 0 > put 'test',' row3', 'data:3',' value3'

0 row (s) in 0.0220 seconds

Hbase (main): 007 scan 0 > test'

ROW COLUMN+CELL

Row1 column=data:1, timestamp=1341662081734, value=value1

Row2 column=data:2, timestamp=1341662107606, value=value2

Row3 column=data:3, timestamp=1341662122336, value=value3

3 row (s) in 0.0640 seconds

Hbase (main): 008 disable 0 > test'

0 row (s) in 2.0590 seconds

Hbase (main): 011 drop 0 > test'

0 row (s) in 1.1650 seconds

Hbase (main): 012 0 > list

TABLE

0 row (s) in 0.0190 seconds

[ate: / local/nomad2/hbase/hbase-0.90.6/bin] > > start-hbase.sh starting master, logging to / local/nomad2/hbase/hbase-0.90.6/bin/../logs/hbase-nomad2-master-ate.out [ate: / local/nomad2/hbase/hbase-0.90.6/bin] > > hbase shellHBase Shell Enter 'help' for list of supported commands.Type "exit" to leave the HBase ShellVersion 0.90.6, r1295128, Wed Feb 29 14:29:21 UTC 2012hbase (main): 001exit 0 > create' test' 'data'0 row (s) in 1.4430 secondshbase (main): 002secondshbase 0 > listTABLE test 1 row (s) in 0.0420 secondshbase (main): 003secondshbase 0 > put 'test' 'row1', 'data:1',' value1'0 row (s) in 0.1500 secondshbase (main): 005value2'0 row 0 > put 'test',' row2', 'data:2',' value2'0 row (s) in 0.0230 secondshbase (main): 006VOO > put 'test',' row3', 'data:3' 'value3'0 row (s) in 0.0220 secondshbase (main): 007secondshbase 0 > scan 'test'ROW COLUMN+CELL row1 column=data:1, timestamp=1341662081734, value=value1 row2 column=data:2, timestamp=1341662107606 Value=value2 row3 column=data:3, timestamp=1341662122336 Value=value3 3 row (s) in 0.0640 secondshbase (main): 008secondshbase 0 > disable 'test'0 row (s) in 2.0590 secondshbase (main): 011 test'0 row 0 > drop' test'0 row (s) in 1.1650 secondshbase (main): 012 test'0 row 0 > listTABLE 0 row (s) in 0.0190 seconds

5. Import data (examples in the book)

Html code

Hbase (main): 013stations', 0 > create 'stations', {NAME = >' info', VERSIONS = > 1}

0 row (s) in 1.1100 seconds

Hbase (main): 014observations', 0 > create 'observations', {NAME = >' data', VERSIONS = > 1}

0 row (s) in 1.1060 seconds

Hbase (main): 015 0 > list

TABLE

Observations

Stations

2 row (s) in 0.0210 seconds

Hbase (main): 013stations', 0 > create 'stations', {NAME = >' info', VERSIONS = > 1} 0 row (s) in 1.1100 secondshbase (main): 014stations', 0 > create 'observations', {NAME = >' data' VERSIONS = > 1} 0 row (s) in 1.1060 secondshbase (main): 015 in 0 > listTABLE observations Stations 2 row (s) in 0.0210 seconds

Html code

> > export HBASE_CLASSPATH=$HBASE_CLASSPATH:ch23.jar

> > hbase HBaseTemperatureImporter input/ncdc/all

> > export HBASE_CLASSPATH=$HBASE_CLASSPATH:ch23.jar > > hbase HBaseTemperatureImporter input/ncdc/all

After the import is complete, view the datasheet from http://ate:60010.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report