Ubuntu16 伪分布模式Hbase 2.3.5 hbase-client 2.3.5


1 前置步骤

Ubuntu16 单机 Hadoop3.2.2 Hbase 2.3.5

环境版本
WindowsWindows10 家庭中文版
JDK1.8.0_291
IDEA2021.1
hbase-client2.3.5

2 配置HBase

2.1 修改hbase-site.xml文件

vim /opt/hbase-2.3.5/conf/hbase-site.xml

在<configuration>标签内插入

<property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.tmp.dir</name>
    <value>./tmp</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/opt/hbase-2.3.5/zookeeper</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
  </property>
  <!-- 此处需配置监听IP地址,否则会引起Bug,详见问题Bug1 -->
  <property>
    <name>hbase.master.ipc.address</name>
    <value>0.0.0.0</value>
   </property>
  <property>
    <name>hbase.regionserver.ipc.address</name>
    <value>0.0.0.0</value>
  </property>

2.2 修改hbase-env.sh文件

vim /opt/hbase-2.3.5/conf/hbase-env.sh

在最后插入

export JAVA_HOME=/opt/jdk1.8.0_291
export HBASE_MANAGES_ZK=true
export HBASE_HOME=/opt/hbase-2.3.5
export HADOOP_HOME=/opt/hadoop-3.2.2

3 配置Host

3.1 配置Ubuntu Host

sudo gedit /etc/hosts

添加Ubuntu的IP地址 Ubuntu的主机名,如:

192.168.192.129 ubuntu

刷新DNS

sudo /etc/init.d/networking restart

刷新DNS

3.2 配置Windows Host

在本地winsows的hosts文件 C:\Windows\System32\drivers\etc 中添加Ubuntu的IP地址 Ubuntu的主机名,如:

192.168.192.129 ubuntu

刷新DNS

ipconfig /flushdns

4 启动HBase

4.1 启动服务

/opt/hbase-2.3.5/bin/start-hbase.sh

启动完成后,可以通过命令 jps 来判断是否成功启动,若成功启动则会列出如下进程: “HMaster”

4.2 访问HBase

http://localhost:16010/
在这里插入图片描述

4.3 测试HBase Shell

打开脚本

hbase shell

调试

status

在这里插入图片描述

5 调试代码

springboot2.3.3+hbase-client2.3.1 操作hbase基本使用

6 参考鸣谢

HBase笔记之踩坑记录:Java远程连接到HBase

Centos7+Hadoop3.1.2+HBase2.2.0搭建过程

Java API远程连接服务器hbase报错:Connection refused: no further information: localhost/127.0.0.1:16000解决

springboot2.3.3+hbase-client2.3.1 操作hbase基本使用

7 问题Bug

7.1 无法连接到HBase 16000端口

2021-07-19 15:05:15.833  INFO 340 --- [           main] o.a.h.h.client.RpcRetryingCallerImpl     : Call exception, tries=6, retries=16, started=18251 ms ago, cancelled=false, msg=java.net.ConnectException: Call to ubuntu/192.168.192.129:16000 failed on connection exception: org.apache.hbase.thirdparty.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: ubuntu/192.168.192.129:16000, details=, see https://s.apache.org/timeout

问题原因:HBase 16000端口未对外开放
执行如下代码可见,16000端口未对外开放

netstat -nautlp|grep 16000

在这里插入图片描述
解决方案:
(1)检查是否配置了Windows和Ubuntu主机的Host文件
(2)配置HBase监听IP地址

7.2 无法连接到HBase

Will not attempt to authenticate using SASL

问题原因:未配置了Windows和Ubuntu主机的Host文件

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值