This project is a example repo for creating a cluster with MariaDB, Redis and RabbitMQ
├── README.md
├── Vagrantfile
├── artifacts.yml
├── constants-maria.yml
├── constants-rabbit.yml
├── constants.yml
├── group_vars
│ └── all
├── install-mariadb.yml
├── install-rabbitmq.yml
├── install.yml
├── inventory.yml
├── main.yml
├── roles
│ ├── add-firewall-services
│ │ └── tasks
│ │ └── main.yml
│ ├── pip-installer
│ │ └── tasks
│ │ └── main.yml
│ └── yum-installer
│ └── tasks
│ └── main.yml
└── templates
├── ctl.j2
├── firewalld
│ └── firewalld_service.j2
├── mariadb
│ ├── Dockerfile.j2
│ ├── docker-entrypoint.sh
│ ├── new_cluster.cnf.j2
│ ├── postinstall.sql.j2
│ ├── site.cnf.j2
│ └── wsrep.cnf.j2
├── rabbitmq
│ ├── Dockerfile.j2
│ ├── advanced.conf.j2
│ ├── docker-entrypoint.sh
│ └── rabbitmq.conf.j2
├── redis
│ └── replica.conf.j2
└── redis-sentinel
└── sentinel.conf.j2
Vagrantfile includes the configuration to create 4 machines
- Control: Machine with ansible capable to connect to all machines and with ansible installed to provision the machines
- MachineX: All role machines that will be installed as part of the cluster. This machines can´t communicate via ssh without password. To access them use the control machine or the
vagrant ssh
In order to run this it is required to previouslly install vagrant-hostmanager
vagrant plugin install vagrant-hostmanager
All machines follow hostname namming convention
<COUNTRY><CITY><UNIQUE_CODE><ROLE><SLA><ID>
- ESBCNACSPROD001: SPAIN BARCELONA A CONTROL_SERVER PROD 0001
- ESBCNAASPROD00X: SPAIN BARCELONA A APP_SERVER PROD 00X
This has used VirtualBox as default provisioner
In order to provision the machines run:
vagrant up
It is recommended to have at least 8GB Memory and 4cores CPU This project requires Virtualization capabilities
This are the following definitions
- global_vars: Variables considered global and not possible to change
- roles
- add-firewall-services: Used to provision firewalld
- pip-installer: used to provision pip packages
- yum-installer: used to provision RPM based packages
- templates: files that can be used for configuration which require variables previouslly defined
- artifacts.yml: list of different artifacts to provision (Docker, pip, yum)
- constants-maria.yml: currently has the firewall template for MariaDB
- constants-rabbit.yml: currently has the firewall template for Rabbit
- constants.yml: currently has the firewall template for Redis
- install-X.yml: Install tasks for different roles
- inventory.yml: Inventory of hosts as well as the variables that can be modified
- main.yml: main package install
All the files are available in control machine from /vagrant
In order to install everything connect to control vagrant ssh control
go to /vagrant
and run
ansible-laybook -i inventory.yml main.yml
in case you want a single role run the specific playbook
Please check service.properties.yaml for more information.