大数据环境部署 第四章——Hbase 伪分布式搭建(使用外部zookeeper)

大数据环境部署 第四章——Hbase 伪分布式搭建(使用外部zookeeper)

前言:本文为系列教程,看到这里默认读者已经配置好了hadoop,zookeeper服务
如果还有未配置好的服务请查阅笔者的前几篇博客
一、准备阶段

  • 1、文件下载
    进入apache官网进行下载Hbase文件
    官网下载地址:https://hbase.apache.org/downloads.html
    在这里插入图片描述
    回到虚拟机内切换到~/opt目录下,使用命令
    wget https://www.apache.org/dyn/closer.lua/hbase/2.1.7/hbase-2.1.7-bin.tar.gz
    下载hbase的归档压缩文件
    在这里插入图片描述

  • 2、解压下载的归档文件
    命令:tar -zxvf hbase-2.1.7-bin.tar.gz hbase-2.1.7/
    在这里插入图片描述

  • 3、解压后的文件夹进行创建软连接
    命令:ln -s hbase-2.1.7 hbase
    在这里插入图片描述
    二、配置Hbase

  • 1、添加环境变量
    vim ~/.bashrc
    在这里插入图片描述
    进入文件后进行如下修改
    在这里插入图片描述
    在这里插入图片描述

  • 2、Hbase相关配置
    (1)cd ~/opt/hbase/conf 切换到hbase的配置目录
    vim hbase-env.sh 编辑文件修改使用外部zookeeper
    在这里插入图片描述
    (2)vim hbase-site.sh 编辑hbase的启动配置
    配置代码:

<configuration>
	<property>
		<name>hbase.rootdir</name>
		<value>hdfs://localhost:9000/hbase</value>
	</property>
	<property>
		<name>hbase.zookeeper.quorum</name>
		<value>localhost</value>
	</property>
	<property>
		<name>hbase.cluster.distributed</name>
		<value>true</value>
	</property>
	<property>
		<name>hbase.master</name>
		<value>localhost:60000</value>
	</property>
</configuration>

在这里插入图片描述
(3)将安装的zookeeper 的zoo.cfg 配置文件拷贝到hbase的配置目录
在这里插入图片描述

三、启动Hbase

  • 1、启动zookeeper
    命令:zkServer.sh start
    在这里插入图片描述
  • 2、启动hadoop
    命令:start-all.sh在这里插入图片描述
  • 3、启动habse
    命令:start-hbase.sh
    在这里插入图片描述
  • 4、查看hbase启动情况
    命令:jps
    在这里插入图片描述
  • 5、进去hbase shell
    命令:hbase shell在这里插入图片描述
    至此Hbase的伪分布式已搭建完成,如果大家在配置的过程中出现问题,欢迎大家进行评论讨论!!!
发布了27 篇原创文章 · 获赞 62 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_42359956/article/details/102924324