Mindmajix

How to Configure Database Services – OpenStack

Configure Database Services

Each of the core OpenStack services (Compute, Identity, Networking, Block Storage) store state and configuration information in databases. The Database service provides a scalable and reliable Cloud Database-as-a-Service functionality for both relational and non-relational database engines. Users can quickly and easily use database features without the burden of handling complex administrative tasks.

OpenStack supports a number of database backends—an internal SQLite database (the default), MySQL, and Postgres. Many OpenStack services maintain a database to keep track of critical resources, usage, and other information. By default, individual SQLite databases are specified for this purpose and are useful for the single-node configuration. For multi-node configurations, a MySQL database is recommended for storing this information.

SQLite is used only for testing and is not supported in a nt, where as MySQL or Postgres usage is down to the experience of the database staff. For the remaining fields of this tutorial we shall use MySQL.

Setting up MySQL is easy and allows you to grow this environment as you progress through the chapters of this tutorial.

Getting started

We will configure our OpenStack Controller services to use MySQL as the database backend, so this needs to be installed prior to configuring our OpenStack Compute environment.

Tip

Refer to the recipe Installing OpenStack Identity Service in Chapter 1, and also Keystone OpenStack Identity Service, for instructions on setting up MySQL.

If you are not already on the OpenStack Controller, ssh into this using Vagrant as follows:

vagrant ssh controller

How to achieve it…

To use OpenStack Compute (Nova), we first need to assure that our backend database has been equipped with the required nova database. To create this, follow the steps below on our controller host running MySQL:

1. With MySQL running, we configure an appropriate database user, called nova, and privileges for use by OpenStack Compute:

MYSQL_ROOT_PASS=openstack

mysql -uroot -p$MYSQL_ROOT_PASS -e ‘CREATE DATABASE nova;’

MYSQL_NOVA_PASS=openstack

mysql -uroot -p${MYSQL_ROOT_PASSWORD} \

-e “GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@’%’ IDENTIFIED BY ‘${MYSQL_NOVA_PASSWORD}’;”

mysql -uroot -p${MYSQL_ROOT_PASSWORD} \

-e “GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@’localhost’ IDENTIFIED BY ‘${MYSQL_NLOVA_PASSWORD}’;”

2. We now simply refer our MySQL server in our /etc/nova/nova.conf file to use MySQL by adding in the sql_connection flag:

sql_connection=mysql://nova:openstack@172.16.0.200/nova

How it works…

MySQL is an essential service to OpenStack as a number of services rely on it. Configuring MySQL appropriately assures that your servers operate smoothly. We added a database called nova that will eventually be populated by tables and data from the OpenStack Compute services and grant all privileges to the nova database user so that user can use it.

Finally, we configured our OpenStack Compute installation to specify these details so that they can use the nova database.

Enroll for Live Instructor Led Online OpenStack Training


0 Responses on How to Configure Database Services – OpenStack"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.