前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >hbase 2.2.3 ZooKeeper cluster setup on linux

hbase 2.2.3 ZooKeeper cluster setup on linux

原创
作者头像
esse LL
发布2023-11-11 11:19:23
2191
发布2023-11-11 11:19:23
举报
文章被收录于专栏:操作系统实验操作系统实验

1. before start

follow all steps in hadoop-3.1.3 cluster setup on linux

and then switch to root user:

代码语言:shell
复制
su

2. cp zookeeper,hbase and extract

代码语言:shell
复制
tar -xzvf /opt/software/apache-zookeeper-3.5.7-bin.tar.gz -C /opt/module
tar -xzvf /opt/software/hbase-2.2.3-bin.tar.gz -C /opt/module

3. setup zookeeper

3.1 config zookeeper

代码语言:shell
复制
mkdir /opt/data/zookeeper
cd /opt/module/apache-zookeeper-3.5.7-bin/conf
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg

sure that the values are like the following contents:

代码语言:txt
复制
tickTime=2000
dataDir=/opt/data/zookeeper
clientPort=2181
maxClientCnxns=60
initLimit=10
syncLimit=5
server.1=master:2888:3888
server.2=slave1:2888:3888

cp zookeeper to slave1:

代码语言:shell
复制
scp -r /opt/module/apache-zookeeper-3.5.7-bin slave1:/opt/module

3.2 start server

代码语言:shell
复制
cd /opt/module/apache-zookeeper-3.5.7-bin
bin/zkServer.sh start

use jps to check QuorumPeerMain

  • todo: fail to start server.2

3.3 connect to server

代码语言:shell
复制
bin/zkCli.sh -server master:2181

try simple cmds in zkshell:

代码语言:shell
复制
ls /
create /zk_test my_data
ls /
get /zk_test
set /zk_test junk
get /zk_test
delete /zk_test
ls /
# for more details: https://hbase.apache.org/book.html#_using_existing_zookeeper_ensemble

use quit to exit.

3.4 stop server

代码语言:shell
复制
cd /opt/module/apache-zookeeper-3.5.7-bin
bin/zkServer.sh stop

3.5 other ops: config systemd

flollow tutorials: creating-and-using-a-systemd-unit-file

4. setup hbase

4.1 add bin to path

代码语言:shell
复制
vi /etc/profile
# add: 
# export HBASE_HOME="/opt/module/hbase-2.2.3"
# export PATH=$PATH:/opt/module/hbase-2.2.3/bin
source /etc/profile

4.2 config env

代码语言:shell
复制
cd /opt/module/hbase-2.2.3/conf
vi hbase-env.sh
# add: 
export JAVA_HOME="/opt/module/jdk8u392-b08"
export HBASE_MANAGES_ZK=false

4.3 config property

代码语言:shell
复制
vi hbase-site.xml

add properties:

代码语言:html
复制
<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://master:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.unsafe.stream.capability.enforce</name>
        <value>false</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>master,slave1</value>
    </property>
</configuration>

4.4 config regionservers

代码语言:shell
复制
vi regionservers

add master and slave1

more details, view https://hbase.apache.org/book.html#fully_dist

5. test hbase

代码语言:shell
复制
hbase version

if all passed, transfer to slave1:

代码语言:shell
复制
scp -r /opt/module/hbase-2.2.3 slave1:/opt/module

6. start hbase

代码语言:shell
复制
#start hdfs:
$HADOOP_HOME/sbin/start-dfs.sh
# start zookeeper:
cd /opt/module/apache-zookeeper-3.5.7-bin
bin/zkServer.sh start

use jps to check datanodes and quorum

代码语言:shell
复制
# start hbase:
start-hbase.sh

use jps to check HMaster and HRegionServer

代码语言:shell
复制
local-master-backup.sh start 2
local-regionservers.sh start 2

7. use shell

to start shell:

代码语言:shell
复制
hbase shell

check namespace cmds:

代码语言:txt
复制
list_namespace
# optional cmds:
Create_namespace 'test1'
describe_namespace 'test1'
  • todo: use hbase manages zk

8. more information

HBase Web UI: http://master:16010

download archive version of pkgs, view http://archive.apache.org/dist/spark/

for more information, view

https://zookeeper.apache.org/doc/r3.4.13/zookeeperStarted.html

https://hbase.apache.org/book.html#fully_dist

https://hbase.apache.org/book.html#quickstart_fully_distributed

https://hbase.apache.org/book.html#_using_existing_zookeeper_ensemble

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-an-apache-zookeeper-cluster-on-ubuntu-18-04

https://www.tutorialspoint.com/hbase/hbase_installation.htm

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. before start
  • 2. cp zookeeper,hbase and extract
  • 3. setup zookeeper
    • 3.1 config zookeeper
      • 3.2 start server
        • 3.3 connect to server
          • 3.4 stop server
            • 3.5 other ops: config systemd
            • 4. setup hbase
              • 4.1 add bin to path
                • 4.2 config env
                  • 4.3 config property
                    • 4.4 config regionservers
                    • 5. test hbase
                    • 6. start hbase
                    • 7. use shell
                    • 8. more information
                    领券
                    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档