I follow these goals for this project:
- Working with git for project management
- Basic monitoring concepts
- Automation using Ansible
- Understanding MariaDB replication flow
- Use different Prometheus exporters
- Work with docker and docker-compose
This project contains two main modules: the MariaDB cluster and monitoring.
- MariaDB cluster with master/slave architecture (One master and two slaves)
- The database serves on port 3306.
- Use ubuntu 20.04 distribution.
- Run MySQL-exporter on each node on port 9104.
- Run node-exporter on each node on port 9100.
- Run max scale for monitoring the cluster.
- Enable auto-failover and auto rejoin max scale.
- Run each service with Docker containers.
- Prometheus for record metrics on port 9090.
- Grafana to visualiaze record from prometheus.
- Add MySQL-exporter and node-exporter dashboard to grafana.
- Set prometheus as grafana data source.
- All automation must consider best practices and role base design
- Use Ansible Vault to encrypt confidential information
- The network interfaces for my servers are controlled by DHCP. The dhclient program overwrote the /etc/resolv. conf file whenever the networking service was restarted, so when I changed the nameservers on /etc/resolv. conf wasn't fixed. I solve this issue by installing the resolvconf package.
To install this package and change nameservers on ubuntu 20.04, go through these steps :
-
Update your package index using apt:
sudo apt update
-
Install the resolvconf package using apt:
sudo apt install resolvconf
-
Add the nameservers to /etc/resolvconf/resolv.conf.d/head .
-
Run the update scripts for this package :
sudo resolvconf -u
-