The mariadb-replication-setup
project is designed to deploy MariaDB master-slave replication clusters
on Ubuntu
(both focal
, jammy
, mantic
). This solution is tailored for use on dedicated physical servers, virtual machines, and within both on-premises and cloud-based infrastructures.
This project currently only facilitates the creation
of new clusters.
This playbook requires root privileges
or sudo
.
- Install
ansible
on control node
apt update && apt install -y ansible
- Clone this repository
git clone https://github.com/vickyphang/mariadb-replication-setup
- Edit the inventory file
Specify hostname, IP addresses (ansible_host
) and connection settings (ansible_user
, ansible_ssh_pass
or ansible_ssh_private_key_file
for your environment
nano inventory
- Edit the variable file vars/main.yml
nano vars/main.yml
Minimum set of variables:
mariadb_version
mariadb_replication_user
# user to connect to the Master server and request binary logsmariadb_replication_password
- (Optional)
create_user
# if set totrue
, create new user. must fillmariadb_user
,mariadb_password
,mariadb_host
- Try to connect and ping to all hosts
ansible all -m ping
- Run playbook
ansible-playbook deploy_cluster.yml