HBaseConEast2016: HBase on Docker with Clusterdock

20
HBase on Docker with clusterdock Dima Spivak

Transcript of HBaseConEast2016: HBase on Docker with Clusterdock

Page 1: HBaseConEast2016: HBase on Docker with Clusterdock

HBase on Docker with clusterdock

Dima Spivak

Page 2: HBaseConEast2016: HBase on Docker with Clusterdock

OverviewIntroduction to Docker (5 min or less!)

clusterdock

Topology for Apache HBase

Demo!

hbase-it upstream

In progress

Page 3: HBaseConEast2016: HBase on Docker with Clusterdock

Introduction to Docker

Virtual machines Docker containers

https://www.docker.com/what-docker

Page 4: HBaseConEast2016: HBase on Docker with Clusterdock

Introduction to DockerIsolated namespaces, process trees

Daemon with REST API and a popular client

docker run …

Tooling

Networking

Images

Registries

Docker Swarm, Docker Compose, ...

Page 5: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdock

Docker tooling designed to support one-process-per-container workflow

No mature tooling for “treat container like a host”

Python-based container-orchestration framework

Started as a hackathon at Cloudera, now open-source

https://github.com/cloudera/clusterdock

Page 6: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdockBuild clusters once, start clusters

repeatedly

Abstractions for cluster-centric entities (e.g. Cluster, Node, NodeGroup)

cluster.ssh(‘wget …’)

workers_nodegroup.ssh(‘cp …’)

Topology defines how to build/start clusters

Page 7: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdock

Page 8: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdockprofile.cfg

actions.py

Page 9: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdock | Topology for Apache HBaseStarted in HBASE-12721, now lives in dev-support

Supports building and starting clusters from binary tarballs or from source

Once image is built, starting a 5-node cluster takes less than 1 minute

Page 10: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdock | Topology for Apache HBasehttps://github.com/apache/hbase/blob/master/dev-support/apache_hbase_topology/actions.py

Page 11: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdock | Topology for Apache HBase

configurations.cfg <configuration> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.rootdir</name> <value>hdfs://node-1.cluster/hbase</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>node-1.cluster</value> </property> <property> <name>hbase.zookeeper.property.datadir</name> <value>/usr/local/zookeeper</value> </property></configuration>

Page 12: HBaseConEast2016: HBase on Docker with Clusterdock

clusterdock | Topology for Apache HBasesource /dev/stdin <<< "$(curl -sL http://tiny.cloudera.com/clusterdock.sh)"

CLUSTERDOCK_TOPOLOGY_IMAGE=apache-docker-hbase.bintray.io/dev/clusterdock:apache_hbase_topology \ clusterdock_run ./bin/start_cluster --registry-url apache-docker-hbase.bintray.io --namespace dev \ apache_hbase --hbase-version=1.2.3 --hadoop-version=2.5.1 --java-version=7u79 --secondary-nodes='node-{2..5}'

clusterdock_ssh node-1.cluster

Page 13: HBaseConEast2016: HBase on Docker with Clusterdock

DEMO

Page 14: HBaseConEast2016: HBase on Docker with Clusterdock
Page 15: HBaseConEast2016: HBase on Docker with Clusterdock

hbase-it upstreamUpstream system testing framework

It works

Finds a lot of serious (e.g. data loss) bugs

Fault-injection via chaos monkey

… but no one runs it upstream

Setting up clusters is hard

Tests take a long time to run

Manual

clusterdock can help

Page 16: HBaseConEast2016: HBase on Docker with Clusterdock

hbase-it upstreamBuild and push clusterdock clusters of

HBase dev branches

master, branch-1.3, branch-1.2, …

Use these pre-built clusters for testing

Can also improve release process

HBASE-16559

Ultimate goal: make passing ITs a quality gate for new features

Page 17: HBaseConEast2016: HBase on Docker with Clusterdock

DEMOclusterdock_ssh node-1.cluster \ hbase org.apache.hadoop.hbase.test.IntegrationTestBigLinkedList -m serverKilling loop 1 4 250000000 dir 4

Page 18: HBaseConEast2016: HBase on Docker with Clusterdock
Page 19: HBaseConEast2016: HBase on Docker with Clusterdock

In progressDocumentation

Moving to infrastructure that can support longer runs

Expanded matrix

More chaos monkeys, configuration options, Java versions, ...

Finding a permanent home for clusterdock