Install a Docker Swarm cluster with Persistent Storage Using GlusterFS
Install a Docker Swarm cluster with Persistent Storage Using GlusterFS
Prerequisites
Your ansible inventory and hosts file should be like this:
cat /etc/hosts
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.221 docker-manager01
192.168.1.222 docker-worker01
192.168.1.223 docker-worker02
cat inventory.ini
[swarm_managers]
docker-manager01
[swarm_workers]
docker-worker01
docker-worker02
[swarm:children]
swarm_managers
swarm_workers
[glusterfs]
docker-manager01
docker-worker01
docker-worker02
Overview
The cluster consists of 3 servers:
- 1 manager
- 2 workers
- A distributed file system
Installation
Run the following playbooks
- ansible-playbook setup_iptables/playbook.yml
- ansible-playbook setup_docker/playbook.yml
- ansible-playbook setup_dockerswarm/playbook.yml
- ansible-playbook setup_glusterfs/playbook.yml