Get the App
SLTechnology News&Howtos  ›  Database  › 

Basic configuration of hbase and hive

Shulou Source: shulou.com Published: 2022-06-01 06:43:03 09月15日 Update

Hadoop configuration was introduced in the previous blog, where hbase and hive are configured directly.

Master node: lab201,slave node: lab201,lab202,lab203

All three nodes perform the following operations (take the master node as an example)

[root@lab201] # tar xf hbase-0.90.6-cdh4u6.tar.gz-C / usr/local/

[root@lab201 local] # ln-sv hbase-0.90.6-cdh4u6/ hbase

[root@lab202 ~] # vim / etc/profile.d/hbase.sh

HBASE_HOME=/usr/local/hbase

PATH=$HBASE_HOME/bin:$PATH

Export HBASE_HOME PATH

[root@lab201] # chown-R hduser.hduser / usr/local/hbase/

Master node configuration:

[root@lab201 conf] # vim hbase-site.xml

Hbase.rootdir hdfs://lab201:8020/hbase hbase.cluster.distributed true hbase.zookeeper.quorum lab201,lab202,lab203 hbase.zookeeper.property.clientPort 2222

[hduser@lab201 ~] $vim / usr/local/hbase/conf/regionservers

Lab201

Lab202

Lab203

[root@lab201 ~] # scp / usr/local/hbase/conf/hbase-site.xml / usr/local/hbase/conf/regionservers hduser@lab202:/usr/local/hbase/conf/

[root@lab201 ~] # scp / usr/local/hbase/conf/hbase-site.xml / usr/local/hbase/conf/regionservers hduser@lab203:/usr/local/hbase/conf/

[hduser@lab201 ~] $start-hbase.sh to view the processes started on the primary node

12717 HRegionServer

13533 HQuorumPeer

13600 HMaster

[hduser@lab202 conf] $jps to view processes started from the node

4025 HRegionServer

3937 HQuorumPeer

Verify that it is normal:

Web accesses port 60010 of master and port 60030 of slave to see if it can be accessed properly.

Use shell to connect to Hbase for functional testing:

[hduser@lab201 ~] $hbase shell

Hbase (main): 003test', 0 > create 'test',' cf'0 row (s) in 1.2200 secondshbase (main): 003VOO > list 'table'test1 row (s) in 0.0550 secondshbase (main): 004Rich 0 > put' test', 'row1',' cf:a', 'value1'0 row (s) in 0.0560 secondshbase (main): 007V0 > scan' test'ROW COLUMN+CELLrow1 column=cf:a, timestamp=1288380727188, value=value11 row (s) in 0.0590 seconds

Hive configuration:

Do the following on all three nodes (take the master node as an example)

[root@lab201] # tar xf hive-0.7.1-cdh4u6.tar.gz-C / usr/local/

[root@lab201 ~] # ln-sv hive-0.7.1-cdh4u6/ hive

[root@lab201] # chown-R hduser.hduser / usr/local/hive/

[root@lab201 ~] # vim / etc/profile.d/hive.sh

HIVE_HOME=/usr/local/hive

PATH=$HIVE_HOME/bin:$PATH

Export HIVE_HOME PATH

Master does the following

[root@lab201 conf] # cp hive-default.xml hive-site.xml

[root@lab201 conf] # cp hive-env.sh.template hive-env.sh

[root@lab201 conf] # scp hive-site.xml hive-env.sh root@lab2:/usr/local/hive/conf/

[root@lab201 conf] # scp hive-site.xml hive-env.sh root@lab3:/usr/local/hive/conf/

Start hive and test:

[hduser@lab203 ~] $hive

Hive > create TABLE pokes (id INT, name string); hive > SHOW TABLES;hive > select * from pokes;hive > drop table pokes

Note: this is only the most basic configuration that allows hbase and hive to run. For more functionality and usage, please refer to the official documentation. The hadoop components used in this lab are downloaded from http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDHTarballs/3.25.2013/CDH3-Downloadable-Tarballs/CDH3-Downloadable-Tarballs.html, so all components have solved compatibility issues. The actual configuration process may need to be adjusted in some places according to the software version and specific conditions.

Tags: Node configuration three function port component process test last article compatibility functional test blog just place official actual situation usage documentation more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple Microsoft macOS Docker