- **Vagrant should be great than
1.6.2
mkdir flocker-tutorial
cd flocker-tutorial
-
Keep in mind the version https://docs.clusterhq.com/en/_version_/_downloads/Vagrantfile
-
(Example, you can use
wget
or paste into your browser)wget https://docs.clusterhq.com/en/1.5.0/_downloads/Vagrantfile
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-add (if no output, your OK)
(If error occurs, run below)
eval $(ssh-agent)
Add your key.
ssh-add ~/.vagrant.d/insecure_private_key
vagrant up
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
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)