Flocker – Docker Data volumes(Updates)

This blog is an update from my previous blog on Flocker. I had faced a bunch of issues while trying out Flocker. Based on the cases raised by me, Flocker team has been kind enough to help me to sort out some of these issues. In this blog, I have updated the cases where I found a workable solution. There are couple of more issues pending. I will update this blog as I make more progress.

Approach 3(Experimental Flocker install with AWS):

Procedure for this tutorial is covered here and case details are covered in this link. The first issue I faced was that the volume creation got stuck. This was because of an operator error on my part w.r.to setting permission for the AWS user to create EBS.

Following is my sample cluster.yml file.

cluster_name: flockertest
 - {public: 52.24.xx.xx, private: 172.31.xx.xx}
 - {public: 52.10.xx.xx, private: 172.31.xx.xx}
control_node: 52.24.xx.xx # or IP address (but you must always connect via TLS to the given name here)
 - username
os: ubuntu # ubuntu or centos
private_key_path: ~/aws/xx.pem # the key used to SSH as root onto the nodes
  version: 1
     hostname: 52.24.xx.xx # control_node should get substituted in here
     port: 4524
    backend: "aws"
    region: "us-west-2"
    zone: "us-west-2b"
    access_key_id: "xxxx"
    secret_access_key: "xxxx"

It is needed to update region, zone, accesskey, secretkey as well as the public and private IP address based on your environment. Flocker team advises to use Ubuntu 14.04 for this, this is available in the AWS free-tier. We need to update <username> with appropriate IAM user created in AWS. It is needed that IAM user should be in “Administrative” group to be allowed to create EBS volume.

After fixing the above issues, I was able to run through the tutorial where I created a volume and attach it to a container. When the container moved, volume also gets moved. I was able to create 100MB volume as well as 100GB volume for the above tests.

Flocker Docker plugin:

I followed this approach to install the Flocker Docker plugin:

flocker-plugin-install cluster.yml

The above command installs Docker as well as the Flocker plugin. For some reason, Docker daemon did not get started automatically. I had to start the Daemon manually on both the hosts using:

sudo /usr/bin/docker -d -s aufs &

When I tried to create a container using Flocker plugin, the command got stuck:

docker run -ti -v test2:/data --volume-driver=flocker busybox sh

The case is tracked here and here and a new Flocker plugin is released to fix this issue. To get the new plugin, we can either completely reinstall the plugin with Docker

flocker-plugin-install cluster.yml

or just update the plugin.

sudo pip install git+https://github.com/clusterhq/flocker-docker-plugin.git
sudo service flocker-docker-plugin restart

To check if the new version of plugin(0.2) is installed:

$ pip show FlockerDockerPlugin
Name: FlockerDockerPlugin
Version: 0.2
Location: /usr/local/lib/python2.7/dist-packages

Following is the Docker version and processes running on control node:

$ sudo docker version
Client version: 1.7.0-dev-experimental
$ ps -eaf|grep flocker
root     14456     1  3 07:38 ?        00:06:02 /opt/flocker/bin/python /usr/sbin/flocker-container-agent --logfile=/var/log/flocker/flocker-container-agent.log
root     14465     1  2 07:38 ?        00:03:34 /opt/flocker/bin/python /usr/sbin/flocker-dataset-agent --logfile=/var/log/flocker/flocker-dataset-agent.log
root     14541     1 13 07:39 ?        00:24:02 /opt/flocker/bin/python /usr/sbin/flocker-control -p tcp:4523 -a tcp:4524 --logfile=/var/log/flocker/flocker-control.log
root     22777     1  3 07:41 ?        00:05:07 /usr/bin/python /usr/local/bin/twistd -noy /usr/local/lib/python2.7/dist-packages/flockerdockerplugin/flockerdockerplugin.tac

After updating the Flocker Docker plugin, I was able to create busybox container, write data to the volume. When I tried to create container with same volume in another host, container creation got stuck till I remove the container from the first host. After exiting the container from first host, I was able to create the container in second host and access the data created from container in first host. Based on the response from Flocker team, this is expected because Flocker can mount a filesystem on only 1 host.

Flocker volume CLI:

After installing flocker-volumes using experimental installer, I was able to run through this tutorial on Flocker volumes CLI.

Flocker volume GUI:

I was able to try out Flocker volumes GUI using the following link. The application runs as a Container in the host machine. Using the browser, I was able to see the volumes that I created using the above AWS example.

One thought on “Flocker – Docker Data volumes(Updates)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s