mirror of
https://github.com/geerlingguy/ansible-for-devops.git
synced 2024-05-19 06:50:03 +00:00
GlusterFS Distributed Filesystem Configuration
This project creates a distributed filesystem on two servers using GlusterFS.
Building the VMs
- Download and install VirtualBox.
- Download and install Vagrant.
- [Mac/Linux only] Install Ansible.
- Run
ansible-galaxy install -r requirements.yml
in this directory to get the required Ansible roles. - Run
vagrant up
to build the VMs and configure the infrastructure.
When Vagrant is finished provisioning the VMs with Ansible, run the following two commands to confirm that Gluster is operating nominally:
# Get status for the Gluster cluster.
$ ansible gluster -i inventory -a "gluster peer status" -b
# Get volume info for the Gluster cluster.
ansible gluster -i inventory -a "gluster volume info" -b
You can also do the following to confirm that files are being replicated/distributed correctly:
- Log into the first server:
vagrant ssh gluster1
- Create a file in the mounted gluster volume:
sudo touch /mnt/gluster/test
- Log out of the first server:
exit
- Log into the second server:
vagrant ssh gluster2
- List the contents of the gluster directory:
ls /mnt/gluster
You should see the test
file you created in step 2; this means Gluster is working correctly!
About the Author
This project was created by Jeff Geerling as an example for Ansible for DevOps.