Previously, the database container was configured for use with Kubernetes. This patch removed any k8s dependencies, adds a script to manage mysql server.cnf settings and splits data and app containers. Splitting the containers provides additional portability and operational efficiencies compared to host mounts. Change-Id: I80656450c02dda5f2959d187eec20d5877dc54a2
1.9 KiB
MariaDB Container Set
The MariaDB database application has been organized into two containers, known as a container-set within the Kolla project. One container runs the MariaDB application and the other stores the actual data.
Operational efficiencies and service stability is provided by separating the application from the stored data. For example, stored data can be backed-up or restored without touching the MariaDB application component.
The containers work in a cooperative fashion by using docker-compose (aka Fig) to ensure the containers are co-located on the same host. With docker-compose, you can manage the containers collectively as a single unit.
Here is a sample docker-compose yaml file for using both MariaDB containers:
mariadbdata:
image: kollaglue/centos-rdo-mariadb-data
volumes:
- /var/lib/mysql:/var/lib/mysql
- /var/log/mariadb:/var/log/mariadb
net: "host"
privileged: true
mariadbapp:
image: kollaglue/centos-rdo-mariadb-app
env_file:
- openstack.env
volumes_from:
- mariadbdata
net: "host"
ports:
- "3306:3306"
privileged: true
In addition to the MariaDB application being organized across two containers, the data container follows the data-only container design pattern. In this design pattern, a dedicated container is used to perform a host mount and separate application container(s) mount volumes from the data-only container instead of performing the host mount directly. In the example above, the MariaDbApp container mounts the /var/lib/mysql and /var/log/mariadb volumes through the MariaDbData container instead of mounting these directly to the Docker host.