2015-10-21 08:39:19 +02:00
|
|
|
SQL database
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Most OpenStack services use an SQL database to store information. The
|
|
|
|
database typically runs on the controller node. The procedures in this
|
|
|
|
guide use MariaDB or MySQL depending on the distribution. OpenStack
|
|
|
|
services also support other SQL databases including
|
|
|
|
`PostgreSQL <http://www.postgresql.org/>`__.
|
|
|
|
|
2017-01-07 14:33:56 +00:00
|
|
|
.. only:: ubuntu
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
2017-02-03 11:13:13 +09:00
|
|
|
As of Ubuntu 16.04, MariaDB was changed to use
|
2017-01-07 14:33:56 +00:00
|
|
|
the "unix_socket Authentication Plugin". Local authentication is
|
2017-02-07 16:19:36 +11:00
|
|
|
now performed using the user credentials (UID), and password
|
2017-01-07 14:33:56 +00:00
|
|
|
authentication is no longer used by default. This means that
|
|
|
|
the root user no longer uses a password for local access to
|
|
|
|
the server.
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-11-11 08:49:46 -07:00
|
|
|
Install and configure components
|
|
|
|
--------------------------------
|
2015-10-21 08:39:19 +02:00
|
|
|
|
|
|
|
#. Install the packages:
|
|
|
|
|
|
|
|
.. only:: ubuntu
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2016-09-28 03:13:12 +09:00
|
|
|
# apt install mariadb-server python-pymysql
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-10-21 08:39:19 +02:00
|
|
|
.. only:: debian
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2016-09-28 03:13:12 +09:00
|
|
|
# apt install mysql-server python-pymysql
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-10-21 08:39:19 +02:00
|
|
|
.. only:: rdo
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2016-02-12 09:46:04 -07:00
|
|
|
# yum install mariadb mariadb-server python2-PyMySQL
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-10-21 08:39:19 +02:00
|
|
|
.. only:: obs
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
# zypper install mariadb-client mariadb python-PyMySQL
|
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2016-09-28 15:51:43 +10:00
|
|
|
.. only:: debian
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-09-27 14:29:19 +08:00
|
|
|
2. Create and edit the ``/etc/mysql/conf.d/openstack.cnf`` file
|
2015-10-21 08:39:19 +02:00
|
|
|
and complete the following actions:
|
|
|
|
|
2016-09-23 15:37:59 +02:00
|
|
|
- Create a ``[mysqld]`` section, and set the ``bind-address``
|
|
|
|
key to the management IP address of the controller node to
|
|
|
|
enable access by other nodes via the management network. Set
|
|
|
|
additional keys to enable useful options and the UTF-8
|
|
|
|
character set:
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. path /etc/mysql/conf.d/openstack.cnf
|
2015-10-21 08:39:19 +02:00
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
[mysqld]
|
|
|
|
bind-address = 10.0.0.11
|
|
|
|
|
|
|
|
default-storage-engine = innodb
|
2017-01-11 18:07:14 +01:00
|
|
|
innodb_file_per_table = on
|
2016-06-20 11:51:18 +08:00
|
|
|
max_connections = 4096
|
2015-10-21 08:39:19 +02:00
|
|
|
collation-server = utf8_general_ci
|
|
|
|
character-set-server = utf8
|
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2016-09-28 15:51:43 +10:00
|
|
|
.. only:: ubuntu
|
|
|
|
|
|
|
|
2. Create and edit the ``/etc/mysql/mariadb.conf.d/99-openstack.cnf`` file
|
|
|
|
and complete the following actions:
|
|
|
|
|
|
|
|
- Create a ``[mysqld]`` section, and set the ``bind-address``
|
|
|
|
key to the management IP address of the controller node to
|
|
|
|
enable access by other nodes via the management network. Set
|
|
|
|
additional keys to enable useful options and the UTF-8
|
|
|
|
character set:
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
[mysqld]
|
|
|
|
bind-address = 10.0.0.11
|
|
|
|
|
|
|
|
default-storage-engine = innodb
|
2017-01-11 18:07:14 +01:00
|
|
|
innodb_file_per_table = on
|
2016-09-28 15:51:43 +10:00
|
|
|
max_connections = 4096
|
|
|
|
collation-server = utf8_general_ci
|
|
|
|
character-set-server = utf8
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
2016-09-28 15:51:43 +10:00
|
|
|
|
2015-10-21 08:39:19 +02:00
|
|
|
.. only:: obs or rdo
|
|
|
|
|
2016-02-12 09:46:04 -07:00
|
|
|
2. Create and edit the ``/etc/my.cnf.d/openstack.cnf`` file
|
2015-10-21 08:39:19 +02:00
|
|
|
and complete the following actions:
|
|
|
|
|
2016-09-23 15:37:59 +02:00
|
|
|
- Create a ``[mysqld]`` section, and set the ``bind-address``
|
|
|
|
key to the management IP address of the controller node to
|
|
|
|
enable access by other nodes via the management network. Set
|
|
|
|
additional keys to enable useful options and the UTF-8
|
|
|
|
character set:
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. path /etc/my.cnf.d/openstack.cnf
|
2015-10-21 08:39:19 +02:00
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
[mysqld]
|
|
|
|
bind-address = 10.0.0.11
|
|
|
|
|
2016-02-12 09:46:04 -07:00
|
|
|
default-storage-engine = innodb
|
2017-01-11 18:07:14 +01:00
|
|
|
innodb_file_per_table = on
|
2016-06-20 11:51:18 +08:00
|
|
|
max_connections = 4096
|
2016-02-12 09:46:04 -07:00
|
|
|
collation-server = utf8_general_ci
|
|
|
|
character-set-server = utf8
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-11-11 08:49:46 -07:00
|
|
|
Finalize installation
|
|
|
|
---------------------
|
2015-10-21 08:39:19 +02:00
|
|
|
|
|
|
|
.. only:: ubuntu or debian
|
|
|
|
|
|
|
|
#. Restart the database service:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
# service mysql restart
|
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-10-21 08:39:19 +02:00
|
|
|
.. only:: rdo or obs
|
|
|
|
|
|
|
|
#. Start the database service and configure it to start when the system
|
|
|
|
boots:
|
|
|
|
|
|
|
|
.. only:: rdo
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
# systemctl enable mariadb.service
|
|
|
|
# systemctl start mariadb.service
|
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2015-10-21 08:39:19 +02:00
|
|
|
.. only:: obs
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
# systemctl enable mysql.service
|
|
|
|
# systemctl start mysql.service
|
|
|
|
|
2016-08-24 02:46:17 +02:00
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|
|
|
|
|
2016-09-28 15:51:43 +10:00
|
|
|
.. only:: rdo or obs or ubuntu
|
2015-10-21 08:39:19 +02:00
|
|
|
|
2016-02-12 09:46:04 -07:00
|
|
|
2. Secure the database service by running the ``mysql_secure_installation``
|
|
|
|
script. In particular, choose a suitable password for the database
|
2017-01-26 15:28:17 +00:00
|
|
|
``root`` account:
|
2015-12-24 19:55:08 +05:30
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
# mysql_secure_installation
|
2016-08-24 02:46:17 +02:00
|
|
|
|
|
|
|
.. end
|
|
|
|
|
|
|
|
.. endonly
|