Skip to content

Simple CEPH container with CEPH-fuse clients

Since I like to play around with Docker volumes one day, I have to get used to CEPH somehow. :)

I started by creating a single container that hosts all ceph-daemons needed and which pushes the necessary information to consuls key/value store: qnib/ceph-mono.

A little stack to demonstrate it could be find - as usual - in my stack repository:

$ git clone -b ceph-helloworld
$ cd orchestra/ceph-helloworld/
$ docker-compose up -d
$ docker-compose up -d
Creating consul
Pulling ceph (qnib/ceph-mono:latest)...
Status: Downloaded newer image for qnib/d-ceph-fuse:latest
Creating cephhelloworld_client_1

After a couple of seconds Consul (<docker-host>:8500) should be all green:


Scale clients

To show that it works between different containers we spin up some more clients:

$ docker-compose scale client=5
Creating and starting 2 ... done
Creating and starting 3 ... done
Creating and starting 4 ... done
Creating and starting 5 ... done

Create Files

Now we can create a file in one container and it's automatically appears in the others.

$ docker exec -ti cephhelloworld_client_1 touch /ceph/testfile_$(date +%F)
$ docker exec -ti cephhelloworld_client_2 ls -l /ceph/
total 0
-rw-r--r-- 1 root root 0 Dec 14 15:12 testfile_2015-12-14

Some bigger files:

$ docker exec -ti cephhelloworld_client_3 dd if=/dev/zero of=/ceph/test50MB_$(date +%s) bs=1MB count=50
$ docker exec -ti cephhelloworld_client_4 ls -l /ceph/
total 48829
-rw-r--r-- 1 root root 50000000 Dec 14 15:14 test50MB_1450106080
-rw-r--r-- 1 root root        0 Dec 14 15:12 testfile_2015-12-14

That's about it... :)