下载或构建hbase docker 镜像
下载hbase docker 镜像
$ docker pull krejcmat/hadoop-hbase-master:latest
$ docker pull krejcmat/hadoop-hbase-slave:latest
构建hbase docker镜像
$ git clone https://github.com/krejcmat/hadoop-hbase-docker.git
$ cd hadoop-hbase-docker
$ ./build-image.sh hadoop-hbase-base
$ docker images
krejcmat/hadoop-hbase-master latest 2f86a3daef76 48 minutes ago 1.091 GB
krejcmat/hadoop-hbase-slave latest ed119b77ecdf 53 minutes ago 1.091 GB
krejcmat/hadoop-hbase-base latest 00fd6c19004f 58 minutes ago 1.091 GB
运行hbase容器集群
进入git下载的项目目录
$ ./start-container.sh latest 2
start master container...
start slave1 container...
脚本运行后,会进入集群master节点的docker容器
检查集群成员
$ serf members
master.krejcmat.com 172.17.0.2:7946 alive
slave1.krejcmat.com 172.17.0.3:7946 alive
首先配置并运行hadoop集群
$ cd ~
$ ./configure-slaves.sh
Warning: Permanently added 'slave1.krejcmat.com,172.17.0.3' (ECDSA) to the list of known hosts.slaves 100% 40 0.0KB/s 00:00
..........
$ ./start-hadoop.sh
#For stop Hadoop ./stop-hadoop.sh
..........
$ jps
342 NameNode
460 DataNode
1156 Jps
615 SecondaryNameNode
769 ResourceManager
862 NodeManager
$ hdfs dfsadmin -report
Name: 172.17.0.2:50010 (master.krejcmat.com)
Hostname: master.krejcmat.com
..........
通过web浏览器访问http://IP:8088 hadoop集群页面
启动hbase集群
$ cd ~
$ ./start-hbase.sh
(hbase(main):001:0>)$ status
2 servers, 0 dead, 1.0000 average load
通过web浏览器访问http://IP:60010 hbase集群页面