Enabling the Flocker Agent Service

The flocker-dataset-agent is the workhorse of Flocker; you should enable and run it on each node in your cluster.

The Flocker Plugin for Docker (flocker-docker-plugin) is also installed on each node in the cluster. The instructions below include enabling and testing the plugin, which allows Flocker to manage your data volumes while using other tools such as Docker, Docker Swarm, or Mesos to manage your containers.

CentOS 7, RHEL 7.2

  1. Run the following commands to enable the agent service:

    systemctl enable flocker-dataset-agent
    systemctl start flocker-dataset-agent
    
  2. Run the following commands to enable the Flocker plugin for Docker:

    systemctl enable flocker-docker-plugin
    systemctl restart flocker-docker-plugin
    

Ubuntu 16.04

  1. Run the following commands to enable the agent service:

    systemctl enable flocker-dataset-agent
    systemctl start flocker-dataset-agent
    
  2. Run the following command to enable the Flocker plugin for Docker:

    systemctl enable flocker-docker-plugin
    systemctl restart flocker-docker-plugin
    

Ubuntu 14.04

  1. Run the following commands to enable the agent service:

    service flocker-dataset-agent start
    
  2. Run the following command to enable the Flocker plugin for Docker:

    service flocker-docker-plugin restart
    

Testing the Flocker Plugin for Docker

Once installed, the example provided below runs two simple Docker tests to verify that the plugin is working correctly with the Flocker agents.

  1. Run the following command, which uses the Flocker plugin for Docker as the volume driver to create a named volume called apples:

    docker run -v apples:/data --volume-driver flocker busybox sh -c "echo hello > /data/file.txt"
    
  2. Run the following command to reattach the same volume from the first container, and verify that the data (hello) has been preserved.

    docker run -v apples:/data --volume-driver flocker busybox sh -c "cat /data/file.txt"
    

Next Step

This completes the manual installation of Flocker for an integration with Docker Swarm.

The next step is to install Docker Swarm. Click the button below to open the Swarm installation instructions provided by Docker - this will open in a new window:


Install Swarm

Or, return to the Flocker installation menu.