개요

Hbase를 로컬 환경에서 돌릴수 있는 방법을 찾아 본 후 정리해둔다.

Docker 이미지 Pull

$ docker pull dajobe/hbase

실행

$ mkdir data
$ id=$(docker run -p 16010:16010 -p 9090:9090 -p 9095:9095 -p 8080:8080 -p 8085:8085 -p 2181:2181 --name=hbase-docker -h hbase-docker -d -v $PWD/data:/data dajobe/hbase)

$ docker ps
CONTAINER ID        IMAGE               COMMAND               CREATED             STATUS              PORTS                                                         NAMES
b44acba62840        dajobe/hbase        "/opt/hbase-server"   10 seconds ago      Up 9 seconds        2181/tcp, 8080/tcp, 8085/tcp, 9090/tcp, 9095/tcp, 16010/tcp   hbase-docker

접속방법

  • http://localhost:16010/master-status for the Master Server
  • http://localhost:9095/thrift.jsp for the thrift UI
  • http://localhost:8085/rest.jsp for the REST server UI
  • http://localhost:16010/zk.jsp for the embedded Zookeeper

실행 검증하기

Hbase 정상실행을 확인하기 위해 hbase shell을 실행해보면 정상동작 함을 알 수 있다.

$ docker exec -it hbase-docker hbase shell
2018-05-16 01:09:33,289 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.4, r67592f3d062743907f8c5ae00dbbe1ae4f69e5af, Tue Oct 25 18:10:20 CDT 2016

hbase(main):008:0> list
TABLE
0 row(s) in 0.0870 seconds

=> []

hbase(main):008:0> exit

참고자료

https://github.com/dajobe/hbase-docker