« Previous 1 2 3
Exploring OpenStack's Trove DBaaS
Cloud Service
Alternatives with Ansible
Almost any automation system provides the tools for editing various database systems. If you aren't using the OpenStack cloud, you could find a way to manage your database with Puppet, Chef, Ansible, or various other solutions. The following example uses Ansible.
It is better to divide the deployment into several steps. The first step involves installing the database. The second step provides the installed database with the desired configuration and then restarts it. In the third and final step, users are created so the application can use MySQL.
Several ready Ansible roles are available on the web that allow you to install and configure the package [5] [6]. To get a working database, you need to create a corresponding inventory file for Ansible and indicate the host where MySQL should end up as its own host group.
A separate playbook, which assigns the MySQL role to this host group, takes care of the rest. In the playbook, you also set the parameters for configuring MySQL. Running the playbook then leads to an executable MySQL on the target system.
Ansible offers additional functions through modules. The module called mysql_user
is perfectly suited for creating users. Because the module calls mysql
in the background, the user needs a suitable configuration file for mysql
when Ansible invokes commands on the target system. The module documentation [7] reveals all the necessary details. Use the mysql_db
module to set up a MySQL database [8].
Conclusions
DBaaS in the cloud brings the database into the future. OpenStack's Trove DBaaS tool provides easy integration with the OpenStack orchestration environment. If you aren't using the cloud, you can still use a solution like Chef or Ansible to automate database management.
Infos
- Trove: https://wiki.openstack.org/wiki/Trove
- Building guest images: http://docs.openstack.org/developer/trove/dev/building_guest_images.html
- Galera cluster: http://galeracluster.com/
- Tesora: http://www.tesora.com/database-as-a-service/
- MySQL for Ansible, no. 1: https://github.com/geerlingguy/ansible-role-mysql
- MySQL for Ansible, no. 2: https://github.com/bennojoy/mysql
- Add MySQL users in Ansible: http://docs.ansible.com/ansible/mysql_user_module.html
- Add MySQL tables in Ansible: http://docs.ansible.com/ansible/mysql_db_module.html
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)