HBase實驗
- 學習HBase 基礎文法。
- 百度了很多 CSDN, 然而并沒有解決我的問題。
- 文章記錄HBase 單機版實驗過程,并配置Web UI界面
安裝過程
- apache.hbase.1.2.6 下載下傳解壓至Linux
- hbase-site.xml 配置
<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
- HBase Shell常用指令
- hbase-site.xml 配置詳解
- hbase shell無法使用倒退鍵的解決方案
- Not starting a distinct region server because hbase.cluster.distributed is false
- Can’t get master address from ZooKeeper; znode data == null” when using Hbase shell