https://hub.docker.com/r/harisekhon/hbase

https://hub.docker.com/r/leoninewang/hbase

https://hub.docker.com/r/dwpdigital/kafka-to-hbase

https://github.com/HariSekhon/Dockerfiles/tree/master/hbase

https://www.github.com/dwp/kafka-to-hbase

https://github.com/apache/hbase


HBase – Hadoop Database,是一个高可靠性、高性能、面向列、可伸缩的分布式存储系统,利用HBase技术可在廉价PC Server上搭建起大规模结构化存储集群。


docker run -ti -p 2181:2181 harisekhon/zookeeper


docker run -d -p 8080:8080 -p 8085:8085 -p 9090:9090 -p 9095:9095 -p 16000:16000 -p 16010:16010 -p 16201:16201 -p 16301:16301 harisekhon/hbase


docker run -d -p 2181:2181 -p 8080:8080 -p 8085:8085 -p 9090:9090 -p 9095:9095 -p 16000:16000 -p 16010:16010 -p 16201:16201 -p 16301:16301 harisekhon/hbase


docker run -ti -p 8020:8020 -p 8032:8032 -p 8088:8088 -p 9000:9000 -p 10020:10020 -p 19888:19888 -p 50010:50010 -p 50020:50020 -p 50070:50070 -p 50075:50075 -p 50090:50090 harisekhon/hadoop


docker run --rm -it --hostname master -p 8020:8020 -p 9000:9000 -p 50010:50010 -p 50070:50070 -p 50075:50075 -p 16000:16000 -p 60000:60000 -p 2181:2181 leoninewang/hbase:1.4.13


http://ip:16010  # Hbase的Web UI


# 使用Hbase

---位于hbase的/bin/目录下

./hbase shell      # 连接Hbase

---退出shell,

quit


---创建一个表,必须要指定表名称和列簇名

create 'test', 'cf'


---删除一个列族 disable alter enable, 注意删除前,需要先把表disable

disable ‘table1’

alter ‘table1’, {NAME=>’tab1_add’, METHOD=>’delete’}

enable ‘table1’


---查看表是否存在 

exists ‘table2’


---判断表是否为‘enable’

is_enabled ‘table1’


---删除一个表

disable ‘table1’

drop ‘table1’


---列出关于你的表的信息

list 'test'

'

---查看表更为详细的信息

describe 'test'


---把数据放到表中

hbase> put ‘t1′, ‘r1′, ‘c1′, ‘value’, ts1

t1指表名,r1指行键名,c1指列名,value指单元格值。ts1指时间戳,一般都省略掉了。

put 'test', 'row1', 'cf:a', 'value1'

put 'test', 'row2', 'cf:a', 'value2'

put 'test', 'row3', 'cf:a', 'value3'


---更新一条记录 put(把scutshuxue年龄改为99)

put ‘member’, ‘scutshuxue’, ‘info:age’, 99


---删除 delete, deleteall

1) 删除行’scutshuxue’, 列族为‘info’ 中age的值

delete ‘member’, ‘scutshuxue’, ‘info:age’

2) 删除整行

deleteall ‘member’, ‘scutshuxue’


---查看表中的所有数据

scan 'test'


---查询表中有多少行

count ‘member’


---将整个表清空

truncate ‘member’


---给'xiaoming'这个id增加'info:age'字段,并使用counter实现递增

incr ‘member’, ‘xiaoming’, ‘info:age’


---获取单行的数据

get 'test', 'row1'


version: '3'
services:
  hbase-master:
    image: harisekhon/hbase:${VERSION:-latest}
    command: master
    ports:
      - 16000:16000
      - 16010:16010
  hbase-regionserver:
    image: harisekhon/hbase:${VERSION:-latest}
    command: regionserver
    ports:
      - 16030:16030
      - 16201:16201
      - 16301:16301
  hbase-thrift:
    image: harisekhon/hbase:${VERSION:-latest}
    command: thrift
    ports:
      - 9090:9090
      - 9095:9095
  hbase-stargate:
    image: harisekhon/hbase:${VERSION:-latest}
    command: stargate
    ports:
      - 8080:8080
      - 8085:8085
  zookeeper:
    image: harisekhon/zookeeper:latest
    ports:
      - 2181:2181


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回