SQL database for Ubuntu¶
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.
注釈
Ubuntu 16.04 では、MariaDB が unix_socket 認証プラグインを使用するよう変更されました。ローカル認証はユーザークレデンシャル (UID) を使用して実行されます。パスワード認証はデフォルトで使用されなくなりました。つまり、root ユーザーはサーバーへのローカルアクセスのためにパスワードを使用できなくなりました。
注釈
As of Ubuntu 18.04, the mariadb-server
package is no longer
available from the default repository. To install successfully,
enable the Universe
repository on Ubuntu.
コンポーネントのインストールと設定¶
パッケージをインストールします。
As of Ubuntu 20.04, install the packages:
# apt install mariadb-server python3-pymysql
As of Ubuntu 18.04 or 16.04, install the packages:
# apt install mariadb-server python-pymysql
ファイル
/etc/mysql/mariadb.conf.d/99-openstack.cnf
を作成、編集し、以下の作業をすべて行います。[mysqld]
セクションを作成して、bind-address
にコントローラーノードの管理 IP アドレスを設定して、管理ネットワーク経由で他のノードによりアクセスできるようにします。その他、有用なオプションや UTF-8 文字セットを有効化するためのキーを設定します。[mysqld] bind-address = 10.0.0.11 default-storage-engine = innodb innodb_file_per_table = on max_connections = 4096 collation-server = utf8_general_ci character-set-server = utf8
インストールの最終作業¶
データベースサービスを再起動します。
# service mysql restart
mysql_secure_installation
スクリプトを実行して、データベースサービスの安全性を向上します。特に、データベースのroot
アカウントに適切なパスワードを選択します。# mysql_secure_installation