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

How to install and configure HBase stand-alone version of Linux platform

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces the Linux platform HBase stand-alone version of how to install and configure, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Download the tar package of HBase for linux platform and extract it. This example is hbase-0.92.1.tar.gz.

# tar zxvf hbase-0.92.1.tar.gz

Enter the Hbase directory hbase-0.92.1

[root@test31 ~] # cd hbase-0.92.1

[root@test31 hbase-0.92.1] #

one。 Modify conf/hbase-env.sh

1)。 Find the JAVA_HOME configuration item, uncomment it, and change the value of JAVA_HOME to the JDK installation location jdk_1.7.0_79 installed on this machine

Export JAVA_HOME=/root/jdk_1.7.0_79

2)。 Find the HBASE_MANAGES_ZK configuration item for ZooKeeper, uncomment it, and set its value to true, otherwise executing create table will report the following error:

ZooKeeper exists failed after 3 retries

3)。 Modify the local / etc/ hosts value to map this IP to the hostname, such as the following configuration:

[root@test31 conf] # cat / etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 test31

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

172.16.16.36 test31

two。 Modify conf/hbase-site.xml and select the directory to which HBase writes the data. This example is / root/hbase. The configuration file is as follows:

Hbase.rootdir

File:/root/hbase

After the configuration of the above two steps is complete, you can start HBase.

The startup command is as follows:

[root@test31 bin] #. / start-hbase.sh

Starting master, logging to / root/hbase-0.92.1/bin/../logs/hbase-root-master-test31.out

Use shell to connect to your HBase

[root@test31 bin] #. / hbase shell

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

Type "exit" to leave the HBase Shell

Version 0.92.1, r1298924, Fri Mar 9 16:58:34 UTC 2012

Hbase (main): 001VR 0 > status

1 servers, 0 dead, 2.0000 average load

Create the test table:

Hbase (main): 003 test', 0 > create 'test',' cf'

0 row (s) in 1.3410 seconds

Hbase (main): 004VR 0 > list

TABLE

Test

Write three rows of data to the test table:

Hbase (main): 005 test', 0 > put 'test',' row1', 'cf:a',' value1'

0 row (s) in 0.1110 seconds

Hbase (main): 006purl 0 >

Hbase (main): 007VR 0*

Hbase (main): 008 test', 0 * put 'test',' row2', 'cf:b',' value2'

0 row (s) in 0.0070 seconds

Hbase (main): 009 test', 0 > put 'test',' row3', 'cf:c',' value3'

0 row (s) in 0.0080 seconds

View the contents of the test:

Hbase (main): 010 scan 0 > test'

ROW COLUMN+CELL

Row1 column=cf:a, timestamp=1488243635205, value=value1

Row2 column=cf:b, timestamp=1488243644421, value=value2

Row3 column=cf:c, timestamp=1488243653378, value=value3

3 row (s) in 0.0430 seconds

The first record of Get:

Hbase (main): 011 test', 0 > get 'test',' row1'

COLUMN CELL

Cf:a timestamp=1488243635205, value=value1

1 row (s) in 0.0540 seconds

The second record of Get:

Hbase (main): 008 get 0 > test','row2'

COLUMN CELL

Cf:b timestamp=1488243644421, value=value2

1 row (s) in 0.0090 seconds

We looked at the write directory of the data and found that the following files and directories were generated, indicating that the write was successful:

[root@test31 hbase] # cd / root/hbase

[root@test31 hbase] # ll

Total dosage 16

-rwxrwxrwx. 1 root root 38 February 28 08:51 hbase.id

-rwxrwxrwx. 1 root root 3 February 28 08:51 hbase.version

Drwxr-xr-x. 4 root root 4096 February 28 08:51-ROOT-

Drwxr-xr-x. 4 root root 4096 February 28 09:00 test

Run the stop script to stop HBase:

[root@test31 bin] #. / stop-hbase.sh

Stopping hbase.

Thank you for reading this article carefully. I hope the article "how to install and configure HBase stand-alone version of Linux platform" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Internet Technology

Wechat

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

12
Report