Based on @vinayakphegde 's original Docker images for HBase and extended to run two clusters side-by-side mainly for HBase Read Replica Cluster feature testing. There are two "conf" folders for the individual cluster with common root directories (/data-store/hbase is mounted from local filesystem), but separated WAL directories and separate ZooKeeper databases. The "hbase" cluster is the Active Cluster while the "hbase2" is the Read Replica Cluster which is set up with global read-only mode enabled.
- Ensure the HBase source code directory is located within the current directory (alongside the Dockerfile and other required files). The directory should contain the HBase source code needed to build the image. The structure should look like this:
. ├── conf1/ ├── conf2/ ├── Dockerfile ├── docker-compose.yml ├── build-images.sh ├── hbase/ │ └── [HBase source files] └── ...
- Create
.env
with the correct details.HBASE_IMAGE=vhegde/hbase-docker HBASE_CONF_DIR=/opt/hbase/conf
- Modify the paths in your
docker-compose.yml
file to be compatible with your filesystem. For example, change:To:volumes: - /Users/andor/tmp/data-store/hbase:/data-store/hbase
volumes: - /Users/<YOUR-USERNAME>/tmp/data-store/hbase:/data-store/hbase
- Make the build script executable:
chmod +x build-images.sh
- Build the images:
./build-images.sh
Start "hbase" cluster:
docker-compose up -d hbase
Start "hbase2" cluster:
docker-compose up -d hbase2
Exec shell inside container:
docker exec -it <container_id> /bin/bash
Shutdown containers:
docker-compose down