Zookeeper&hbase installation Process

Source: Internet
Author: User
Tags zookeeper
Zookeeper installation process: 1. Download and unzip zookeeper

Download and unzip the zookeeper-3.4.6.tar.gz command as follows

]# TAR–ZXVF zookeeper-3.4.6.tar.gz

]# MV Zookeeper-3.4.6/home/hadoop//zookeeper is placed in the Hadoop directory for easy management of 2. Adding environment variables

Modify/etc/profile

]# Vim/etc/profile

Export zookeeper_home=/home/hadoop/zookeeper-3.4.6

Exportpath= $PATH: $HADOOP _home/bin: $HADOOP _home/sbin: $JAVA _home/bin: $HBASE _home/bin: $ZOOKEEPER _home/bin

]# source/etc/profile//Make profile effective 3. Modify Zoo.cfg

Open $zookeepr_home/conf, modify Zoo.cfg

] #cp zoo.cfg.sample zoo.cfg

Add the following items:

Datalogdir=/home/hadoop/zk/logs//log Path

Datadir=/home/hadoop/zk/data//data directory, myid files stored

clientport=2181//Default port

server.1=bihbasemaster:2888:3888//configuration of several zookeeper as a cluster

server.2=bihbaseregionserver01:2888:3888

server.3=bihbaseregionserver02:2888:3888

server.4=bihbaseregionserver03:2888:3888

server.5=bihbaseregionserver04:2888:3888 4. Creating folders and corresponding files

Creating Catalogs/home/hadoop/zk/logs and/home/hadoop/zk/data

]# Mkdir–p/home/hadoop/zk/logs/home/hadoop/zk/data

generate the myID file in/home/hadoop/zk/data, the file will be generated on each machine, the contents of the machine in the cluster number, starting from 1 increments. 5. Copy the folders separately to each datanode

scp–r/home/hadoop/zk//home/hadoop/zookeeper-3.4.6 Root@bs1:/home/hadoop

scp–r/home/hadoop/zk//home/hadoop/zookeeper-3.4.6 Root@bs2:/home/hadoop

scp–r/home/hadoop/zk//home/hadoop/zookeeper-3.4.6 Root@bs3:/home/hadoop

scp–r/home/hadoop/zk//home/hadoop/zookeeper-3.4.6 Root@bs4:/home/hadoop

6. Start the zookeeper on each machine separately

Start Zookeeper

]# zkserver.sh Start

Stop Zookeeper

] #zkServer. SH stop

Note: The boot order is hadoop->zookeeper->hbase

Stop Order is Hbase->zookeeper->hadoop



Zookeeper Issue highlights: 1. File loss

Description: Caused by:java.lang.IllegalArgumentException:/home/hadoop/zk/data/myidfile is missing

Cause: Startup does not create the myID file under the data file, but also writes the number in sequence

Workaround: Generate the myID file in the Data folder of each machine, and write the number in sequence 2. Connection Rejection

The connection is denied and remains to be resolved.

hbase installation process: 1. Download and unzip

Download and unzip the hbase-1.1.2-bin.tar.gz command as follows

]# TAR–ZXVF hbase-1.1.2-bin.tar.gz

]# MV Hbase-1.1.2/home/hadoop//Unified Mobile to the Hadoop directory for easy management 2. Add environment variables

Modify/etc/profile

]# Vim/et/profile

Export hbase_home=/home/hadoop/hbase-1.1.2

exportpath= $PATH: $HADOOP _home/bin: $HADOOP _home/sbin: $JAVA _home/bin: $HBASE _home/bin: $ZOOKEEPER _home/bin 3. Modify hbase-env.sh

Export java_home=/home/hadoop/jdk1.7.0_79//jdk Path

Exporthbase_pid_dir=/home/hadoop/hbasepiddir//folder to store HBase PID

exporthbase_manages_zk=false//false table name does not use HBase's own zookeeper, I use zookeeper-3.4.6 4. Modify Hbase-site.xml

<configuration>

<property>

<name>hbase.rootdir</name>

<value>hdfs://bihbasemaster/hbase</value>//hbase Path on HDFs

</property>

<property>

<name>hbase.cluster.distributed</name>//hbase Fully Distributed installation

<value>true</value>

</property>

<property>

<name>hbase.zookeeper.property.clientPort</name>//hbase does not use its own zookeeper to match these options, Zookeepe's external port

<value>2181</value>

</property>

<property>

<name>hbase.zookeeper.quorum</name>//Specify Zookper cluster

<value>bhm,bs1,bs2,bs3,bs4</value>

</property>

<property>

<name>hbase.zookeeper.property.dataDir</name>//zookeeper Path

<value>/home/hadoop/zk/data</value>

</property>

<property>

<name>hbase.master.info.port</name>

<value>60010</value>

</property>

</configuration> 5. Modify Regionservers

6. run hbase

]# start-hbase.sh

See how the Datanode works

start successfully, you can use stop-hbase.sh to stop hbase 7. Enter HBase Shell to view, insert data

]# HBase Shell

Ways to use the hbase shell under the shell:

Echo "Scan ' test123 '" |hbase shell >123.txt

This command does not have to start the hbase shell, and the table scan out into the 123.txt

hbase Issue highlights: 1. Unable to connect to 8020 ports

After the start of the start-hbase.sh, the Namenode on the Hmaster started and then quickly exited, while the other regionserver hregionserver intact, view Namenode logs after the discovery

Java.net.ConnectException:Call from dw-server20-30.xs.paic.com.cn/172.16.20.30 to bihbasemaster:8020failed on Connection Exception:java.net.ConnectException:Connection refused;

Unable to connect 8020 port, 8020 port HDFs default port, Hmaster need to go through 8020 to connect HDFs

Parameters

Describe

Default

Configuration file

Example values

Fs.default.name

Namenode RPC Interactive port

8020

Core-site.xml

hdfs://master:8020

In Core-site.xml, the configuration is

<property>

<name>fs.defaultFS</name>

<value>hdfs://bhm:9000</value>

</property>

Workaround: Remove 9000, use the default port, reboot hadoop,hbase intact 2. Configuration Item Error

View Hbase-root-master-dw-server20-30.xs.paic.com.cn.log in the logs directory and discover Warnning

2015-10-22 21:01:06,654warn [Dw-server20-30.wlt,16000,1445508958421_choreservice_1]hbase. Hbaseconfiguration:config option "Hbase.regionserver.lease.period" is deprecated. Instead, use "Hbase.client.scanner.timeout.period"

Description: Configuration item hbase.regionserver.lease.period not recommended, recommended Hbase.client.scanner.timeout.period

Resolution: Modify the Hbase-site.xml to change the corresponding. 3. Connection rejection

Symptoms: After the start-hbase.sh, Hmaster started, and after a while quit,

Log error is as follows

Reason:

<property>

<name>hbase.rootdir</name>

<value>hdfs://127.0.0.1/hbase</value> here is not configured, Hmaster cannot find the path to HDFs, so it is not even on HDFs

</property>

Solve:

<property>

<name>hbase.rootdir</name>

<value>hdfs://namenode/hbase</value> changed to such a form

</property>

4. Unable to build the table:

At Org.apache.hadoop.hbase.master.handler.CreateTableHandler.prepare (createtablehandler.java:137)

Atorg.apache.hadoop.hbase.master.HMaster.createTable (hmaster.java:1860)

Cause: HBase cluster not working properly


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.