Dozone & Dev Tools

Dozone stands for docker for ozone. Ozone supports docker to make it easy to develop and test ozone. Starting a docker-based ozone container is simple.

In the compose/ozone directory there are two files that define the docker and ozone settings.

Developers can

cd compose/ozone

and simply run

docker-compose up -d

to run a ozone cluster on docker.

This command will launch OM, SCM and a data node.

To access the OM UI, one can view http://localhost:9874.

Please note: dozone does not map the data node ports to the 9864. Instead, it maps to the ephemeral port range. So many examples in the command shell will not work if you run those commands from the host machine. To find out where the data node port is listening, you can run the docker ps command or always ssh into a container before running ozone commands.

To shutdown a running docker-based ozone cluster, please run

docker-compose down

Adding more config settings

The file called docker-config contains all ozone specific config settings. This file is processed to create the ozone-site.xml.

Useful Docker & Ozone Commands

If you make any modifications to ozone, the simplest way to test it is to run freon and unit tests.

Here are the instructions to run freon in a docker-based cluster.

docker-compose exec datanode bash

This will open a bash shell on the data node container. Now we can execute freon for load generation.

ozone freon randomkeys --numOfVolumes=10 --numOfBuckets 10 --numOfKeys 10

Here is a set of helpful commands for working with docker for ozone. To check the status of the components:

docker-compose ps

To get logs from a specific node/service:

docker-compose logs scm

As the WebUI ports are forwarded to the external machine, you can check the web UI:

  • For the Storage Container Manager: http://localhost:9876
  • For the Ozone Manager: http://localhost:9874
  • For the Datanode: check the port with docker ps (as there could be multiple data nodes, ports are mapped to the ephemeral port range)

You can start multiple data nodes with:

docker-compose scale datanode=3

You can test the commands from the Ozone CLI after opening a new bash shell in one of the containers:

docker-compose exec datanode bash