---
title: "hbase 2.1.1 单机部署"
author: "lfwer"
date: "2018-11-05T17:52:31Z"
tags: []
categories: ["数据库"]
slug: "hbase-2-1-1"
draft: false
lastmod: "2018-11-05T17:53:48Z"
id: 2433275
url: "https://lfwer.iteye.com/blog/2433275"
---

#下载hbase

wget https://mirrors.cnnic.cn/apache/hbase/2.1.1/hbase-2.1.1-bin.tar.gz

 

#下载jdk1.8

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

 

#上传jdk

rz -bye 

 

#解压jdk和hbase

tar -zxvf jdk-8u191-linux-x64.tar.gz 

tar -zxvf hbase-2.1.1-bin.tar.gz

 

#配置hbase环境变量

vi /etc/profile

export HBASE\_HOME=/home/hbase-2.1.1

export PATH=$PATH:$HBASE\_HOME/bin

source /etc/profile

 

#修改hbase-env.sh

vi /home/hbase-2.1.1/conf/hbase-env.sh

export JAVA\_HOME=/home/jdk1.8.0\_191

export HBASE\_CLASSPATH=/home/hbase-2.1.1/conf

export HBASE\_MANAGES\_ZK=true

 

#修改hbase-site.xml

vi /home/hbase-2.1.1/conf/hbase-site.xml

```
<configuration>
  <property>
      <name>hbase.rootdir</name>
      <value>file:///home/hbase-2.1.1/logs/site</value>
  </property>
   <property>
      <name>hbase.tmp.dir</name>
      <value>/home/hbase-2.1.1/tmp</value>
  </property>
  <property>
      <name>hbase.cluster.distributed</name>
      <value>true</value>
  </property>
  <property>
      <name>hbase.zookeeper.quorum</name>
      <value>lfwer</value>
  </property>
</configuration>
```

 

#查看hbase是否安装成功

hbase version

 

#启动hbase

/home/hbase-2.1.1/conf/.start-hbase.sh

 

#用hbase shell 访问一下

hbase shell

 

HBase Shell

Use "help" to get list of supported commands.

Use "exit" to quit this interactive shell.

For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell

Version 2.1.1, rb60a92d6864ef27295027f5961cb46f9162d7637, Fri Oct 26 19:27:03 PDT 2018

Took 0.0020 seconds                                                                                                                    

hbase(main):001:0&gt; 

hbase(main):002:0* 

 

#执行list命令

hbase(main):002:0* list

TABLE                                                                                                                                  

test                                                                                                                                   

1 row(s)

Took 0.3306 seconds                                                                                                                    

=&gt; \["test"]

hbase(main):003:0&gt; 

 

 #通过浏览器查看hbase状态信息

http://ip:16030