Skip to content

Instantly share code, notes, and snippets.

@wallnerryan
Last active October 30, 2015 18:18
Show Gist options
  • Save wallnerryan/d13dc37a970de707f15b to your computer and use it in GitHub Desktop.
Save wallnerryan/d13dc37a970de707f15b to your computer and use it in GitHub Desktop.

Getting Started

  • **Vagrant should be great than 1.6.2
Create a working dir
mkdir flocker-tutorial
cd flocker-tutorial
Download Vagrantfile
Download Certificates
  • wget https://docs.clusterhq.com/en/1.5.0/_downloads/cluster.crt
  • wget https://docs.clusterhq.com/en/1.5.0/_downloads/user.crt
  • wget https://docs.clusterhq.com/en/1.5.0/_downloads/user.key
SSH Configuration
ssh-add (if no output, your OK)

(If error occurs, run below)

eval $(ssh-agent)

Add your key.

ssh-add ~/.vagrant.d/insecure_private_key
Run it

vagrant up

Adding Docker Plugin

Get status of VMs

vagrant status

SSH into your nodes and install flocker docker plugin.

vagrant ssh node1
sudo su
cd credentials/
/opt/flocker/bin/flocker-ca create-api-certificate plugin
cp plugin.* /etc/flocker
yum install -y clusterhq-flocker-docker-plugin
systemctl enable flocker-docker-plugin
systemctl start flocker-docker-plugin
systemctl restart flocker-docker-plugin

Exit from that node

exit
exit

Node 2

vagrant ssh node2
sudo su
cd /etc/flocker/

The password for the next command (scp) is vagrant

scp root@172.16.255.250:/home/vagrant/credentials/plugin* .
yum install -y clusterhq-flocker-docker-plugin
systemctl enable flocker-docker-plugin
systemctl start flocker-docker-plugin
systemctl restart flocker-docker-plugin

Exit out of node2

exit
exit
Test our your local flocker cluster
vagrant ssh node1
docker run -v apples:/data --volume-driver flocker busybox sh -c "echo hello > /data/file.txt"
docker run -v apples:/data --volume-driver flocker busybox sh -c "cat /data/file.txt"

Also, if you have uft-flocker-tools installed locally, it works!

uft-flocker-volumes --control-service=172.16.255.250 list
DATASET                                SIZE     METADATA      STATUS         SERVER                    
daeccf0a-d3c1-4c8c-8015-205c332f5b42   75.00G   name=apples   attached ✅   43a06d55 (172.16.255.250) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment