2024-04-29 HBase的安装部署

HBase的安装部署

部署HBase必须配置先部署好 JDK、Hadoop、Zookeeper,配置3台服务器就要加,启动只需要启动028即可

1、配置环境变量

[bxwl@snode028 hbase-2.4.11]$ cat /etc/profile.d/bxwl.sh

export JAVA_HOME=/opt/jdk1.8.0_291

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export HADOOP_HOME=/opt/hadoop-3.3.2

#export HADOOP_CONF_DIR=/opt/hadoop-3.3.2/etc

export HBASE_HOME=/opt/hbase-2.4.11

export HBASE_CONF_DIR=${HBASE_HOME}/conf

export PATH=${JAVA_HOME}/bin:${HADOOP_HOME}/bin:${HBASE_HOME}/bin:$PATH

2、配置hbase-env.sh

HBase不使用自带的Zookeeper。这里其实都是配置环境变量,在上一步其实也可以完成。可以试试

[bxwl@snode028 hbase-2.4.11]$ cd conf

[bxwl@snode028 conf]$ vim hbase-env.sh

export HBASE_MANAGES_ZK=false

3、配置hbase-site.xml

[bxwl@snode028 conf]$ vim hbase-site.xml

<configuration>

  <!--The following properties are set for running HBase as a single process on a

    developer workstation. With this configuration, HBase is running in

    "stand-alone" mode and without a distributed file system. In this mode, and

    without further configuration, HBase and ZooKeeper data are stored on the

    local filesystem, in a path under the value configured for `hbase.tmp.dir`.

    This value is overridden from its default value of `/tmp` because many

    systems clean `/tmp` on a regular basis. Instead, it points to a path within

    this HBase installation directory.

    Running against the `LocalFileSystem`, as opposed to a distributed

    filesystem, runs the risk of data integrity issues and data loss. Normally

    HBase will refuse to run in such an environment. Setting

    `hbase.unsafe.stream.capability.enforce` to `false` overrides this behavior,

    permitting operation. This configuration is for the developer workstation

    only and __should not be used in production!__

    See also https://hbase.apache.org/book.html#standalone_dist-->

  <property>

    <name>hbase.cluster.distributed</name>

    <value>true</value>

  </property>

  <property>

    <name>hbase.tmp.dir</name>

    <value>./tmp</value>

  </property>

  <property>

    <name>hbase.unsafe.stream.capability.enforce</name>

    <value>false</value>

  </property>

  <property>

    <name>hbase.rootdir</name>

    <value>hdfs://snode028:8020/hbase</value>

  </property>

  <property>

    <name>hbase.zookeeper.quorum</name>

    <value>snode028,snode029,snode030</value>

  </property>

  <property>

    <name>zookeeper.znode.parent</name>

    <value>/hbase</value>

  </property>

  <property>

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

    <value>/opt/apache-zookeeper-3.8.0-bin/zkData</value>

  </property>

  <property>

    <name>hbase.wal.provider</name>

    <value>filesystem</value>

  </property>

</configuration>

4、配置regionservers

[bxwl@snode028 conf]$ vim regionservers

snode028

snode029

snode030

5、软连接 hadoop 配置文件到 HBase

[bxwl@snode028 conf]$ ln -s /opt/hadoop-3.3.2/etc/hadoop/core-site.xml /opt/hbase-2.4.11/conf/core-site.xml

[bxwl@snode028 conf]$ ln -s /opt/hadoop-3.3.2/etc/hadoop/hdfs-site.xml /opt/hbase-2.4.11/conf/hdfs-site.xml

6、启动关闭HBase

// 启动

[bxwl@snode028 hbase-2.4.11]$ bin/start-hbase.sh

[bxwl@snode028 hbase-2.4.11]$ ~/bin/jpsall

---------- snode028 jps ------------

7809 NameNode

10468 HMaster

10680 HRegionServer

7961 DataNode

8234 NodeManager

11131 Jps

6029 QuorumPeerMain

---------- snode029 jps ------------

6784 SecondaryNameNode

6866 NodeManager

6675 DataNode

5750 QuorumPeerMain

10877 HRegionServer

11166 Jps

---------- snode030 jps ------------

9160 HRegionServer

5595 QuorumPeerMain

9467 Jps

7276 NodeManager

6973 DataNode

7150 ResourceManager

[bxwl@snode028 hbase-2.4.11]$

// 关闭

[bxwl@snode028 hbase-2.4.11]$ bin/stop-hbase.sh

浏览器直接访问:http://ip:16010

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Hadoop的安装部署 下载安装包,放置服务器安装目录并解压[https://note.youdao.com/md...
    麒麟财子阅读 3,471评论 0 0
  • 一、概述HBase是一个高可用、高性能、面向列、可伸缩的分布式存储系统。适合存储大表数据。二、安装准备1、Hado...
    路过的南国风阅读 3,465评论 0 0
  • 一、Hbase简介 HBase是Apache Hadoop的数据库,能够对大型数据提供随机、实时的读写访问,是Go...
    鹅鹅鹅_阅读 2,713评论 0 1
  • 2.1、部署 2.1.1、Zookeeper正常部署 首先保证Zookeeper集群的正常部署,并启动之: /op...
    码农GG阅读 3,931评论 0 0
  • 1.先决条件(HBase 依赖的一些重要的中间件、系统服务或配置) 1)运行时环境JDK 2)SSH 服务 集群模...
    柳仁儿阅读 9,706评论 0 2