ERROR: Can't get master address from ZooKeeper; znode data == null when using Hbase shell(单机版,HBase)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_24452475/article/details/79982071

HBase实验

  • 学习HBase 基础语法。
  • 百度了很多 CSDN, 然而并没有解决我的问题。
  • 文章记录HBase 单机版实验过程,并配置Web UI界面

安装过程

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>file:///opt/hbase/hbase_db</value>
    </property>
</configuration>
  • 启动命令
    • hbase-1.2.6/bin/start-hbase.sh

HBase 基本操作

  • 启动/停止 hbase
hbase-1.2.6/bin/start-hbase.sh  # 启动hbase

hbase-1.2.6/bin/start-hbase.sh  # 停止hbase

hbase-1.2.6/bin/hbase shell  # 启动hbase shell
  • hbase 基本操作命令
quit    # 退出 hbase shell

create 'test', 'cf'  # 创建表,必须指定表名和列簇名

list / list 'test'  # 列出表信息

describe 'test'  # 获取表描述

drop 'test'  # 删除表

exists 'test'  # 检查表是否存在

put 'test', 'row1', 'cf:a', 'value1'  # 向表中插入数据
put 'test', 'row2', 'cf:b', 'value2
put 'test', 'row3', 'cf:c', 'value3'

scan 'test'  # 扫描全表数据

get 'test', 'row1'  # 获取行数据

put 'test','row3','cf:c' ,'E'  # 更新行数据

disable 'test'  # 禁用一张表

enable 'test'  # 禁用一张表

HBase Web UI 界面访问方式

  • Browse to the Web UI
    • 0.98版本一下默认访问端口60010;
    • 0.98版本以上,默认访问端口 16010。
    • NOTE
Web UI Port Changes
In HBase newer than 0.98.x, the HTTP ports used by the HBase Web UI changed from 60010 for the Master and 60030 for each RegionServer to 16010 for the Master and 16030 for the RegionServer.

If everything is set up correctly, you should be able to connect to the UI for the Master 

http://nodea.example.com:16010/ 

or the secondary master at 

http://node-b.example.com:16010/
for the secondary master, using a web browser. If you can connect via localhost but not from another host, 

check your firewall rules.

You can see the web UI for each of the RegionServers at port 16030 of their IP addresses, or by clicking their links in the web UI for the Master

HRegionServer 不能启动日志

  • 启动需要分布式集群环境
2018-04-17 22:26:23,310 INFO  [main] util.VersionInfo: HBase 1.2.6
2018-04-17 22:26:23,311 INFO  [main] util.VersionInfo: Source code repository file:///home/busbey/projects/hbase/hbase-assembly/target/hbase-1.2.6 revision=Unknown
2018-04-17 22:26:23,311 INFO  [main] util.VersionInfo: Compiled by busbey on Mon May 29 02:25:32 CDT 2017
2018-04-17 22:26:23,311 INFO  [main] util.VersionInfo: From source with checksum 7e8ce83a648e252758e9dae1fbe779c9
2018-04-17 22:26:24,074 WARN  [main] regionserver.HRegionServerCommandLine: Not starting a distinct region server because hbase.cluster.distributed is false

References

猜你喜欢

转载自blog.csdn.net/qq_24452475/article/details/79982071
今日推荐