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+hbase+zookeeper fully distributed installation (2)

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

One installation preparation

After we successfully installed hadoop in the previous article, we can go on to install hbase. According to the corresponding table in the previous article, we choose to download the appropriate version of hbase. The version selected for this case is hbase-0.94.10.tar.gz. Zookeeper-3.4.6.tar.gz

Please refer to the previous article for the pre-installation environment.

2 installation operation

Install zookeeper first

1. Unpack the installation package

Tar zxvf zookeeper-3.4.6.tar.gz

Mv zookeeper-3.4.6 / usr/local/zookeeper

two。 Modify the creation profile

Cp zookeeper/conf/zoo.sample.cfg zookeeper/conf/zoo.cfg

Vim zookeeper/conf/zoo.cfg

3. The main changes are as follows

DataDir=/usr/local/zookeeper/data

ClientPort=2181

Server.1=master:2888:3888

Server.2=slave1:2888:3888

Server.3=slave2:2888:3888

4. Then package the entire zookeep and configure it to the other two.

Scp-r / usr/local/zookeeper slave1:/usr/local

Scp-r / usr/local/zookeeper slave2:/usr/local

5. Create a file in the zookeeper/data folder of master, myid, and enter the value 1

Vim zookeeper/data/myid 1

same

Slave1

Vim zookeeper/data/myid 2

Slave2

Vim zookeeper/data/myid 3

6. Start zookeeper

Run on three machines

Zookeeper/bin/zkServer.sh start to start.

Zookeeper/bin/zkServer.sh stop to shut down

Install hbase

The installation of hbase is fairly simple. Just decompress it. It's mainly a matter of changing the code.

First decompress the compressed package and change the name

Tar zxvf hbase-0.94.10.tar.gz

Mv hbase-0.94.10/ / usr/local/hbase

Then enter the conf

1. Modify the configuration file hbase-site.xml and add it to configuration

Hostname of the master of the hbase.rootdir configuration hadoop

Hdfs://master:9000/hbase

Whether hbase.cluster.distributed runs in a distributed manner

True

Hbase.zookeeper.property.clientPort zookeeper connection port

2181

List of hbase.zookeeper.quorum zookeeper servers (preferably odd)

Master,slave1,slave2

Hbase.zookeeper.property.dataDir zookeeper data directory

/ usr/local/zookeeper/data

two。 Modify the configuration file hbase-env.sh to add to the bottom of the file

Export JAVA_HOME=/home/songtao/jdk1.6.0_35 JAVA directory

Export HBASE_MANAGES_ZK=false disables zookeeper that comes with HBASE

Export HBASE_HOME=/usr/local/hbase

3. Edit the regionservers file to add two RegionServer:

Slave1

Slave2

4. Configure the other two, and copy the entire configured hbase to the same path of the other two.

Scp-r / usr/local/hbase slave1:/usr/local

Scp-r / usr/local/hbase slave2:/usr/local

Three runs & stop Hbase

Hadoop must be turned on before running Hbase. The commands to run and stop are as follows

/ usr/local/hbase/bin/start-hbase.sh

/ usr/local/hbase/bin/stop-hbase.sh

After running hbase, you will see the following processes

Master

Slave

The startup sequence of the whole cluster

Start hadoop-- > zookeeper-- > hbase

Close hbase-- > zookeeper-- > hadoop

test

1. Enter hbase shell and use the status command to check the cluster status, as follows:

2. Build a test table:

Hbase (main): 005 0 > create 't3recording

3. Log in to the other two machines to see if the data can be found:

Hadoop fs-ls / hbase

Check that hdfs,t3 has been generated:

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