Database Most OpenStack services require a database to store information. These examples use a MySQL database that runs on the controller node. You must install the MySQL database on the controller node. You must install the MySQL Python library on any additional nodes that access MySQL. Most OpenStack services require a database to store information. This guide uses a MySQL database on SUSE Linux Enterprise Server and a compatible database on openSUSE running on the controller node. This compatible database for openSUSE is MariaDB. You must install the MariaDB database on the controller node. You must install the MySQL Python library on any additional nodes that access MySQL or MariaDB.
Controller setup For SUSE Linux Enterprise Server: On the controller node, install the MySQL client and server packages, and the Python library. # zypper install mysql-client mysql python-mysql For openSUSE: On the controller node, install the MariaDB client and database server packages, and the MySQL Python library. # zypper install mariadb-client mariadb python-mysql # apt-get install python-mysqldb mysql-server # yum install mysql mysql-server MySQL-python When you install the server package, you are prompted for the root password for the database. Choose a strong password and remember it. The MySQL configuration requires some changes to work with OpenStack. Edit the /etc/mysql/my.cnf file: Edit the /etc/my.cnf file: Under the [mysqld] section, set the bind-address key to the management IP address of the controller node to enable access by other nodes via the management network: [mysqld] ... bind-address = 10.0.0.11 Under the [mysqld] section, set the following keys to enable InnoDB, UTF-8 character set, and UTF-8 collation by default: [mysqld] ... default-storage-engine = innodb innodb_file_per_table collation-server = utf8_general_ci init-connect = 'SET NAMES utf8' character-set-server = utf8 Restart the MySQL service to apply the changes: # service mysql restart Start the MySQL MariaDB or MySQL database server and set it to start automatically when the system boots: # service mysqld start # chkconfig mysqld on # service mysql start # chkconfig mysql on Finally, you should set a root password for your MySQL MariaDB or MySQL database. The OpenStack programs that set up databases and tables prompt you for this password if it is set. You must delete the anonymous users that are created when the database is first started. Otherwise, database connection problems occur when you follow the instructions in this guide. To do this, use the mysql_secure_installation command. Note that if mysql_secure_installation fails you might need to use mysql_install_db first: # mysql_install_db # mysql_secure_installation If you have not already set a root database password, press ENTER when you are prompted for the password. This command presents a number of options for you to secure your database installation. Respond yes to all prompts unless you have a good reason to do otherwise.
Node setup On all nodes other than the controller node, install the MySQL Python library: # apt-get install python-mysqldb # yum install MySQL-python # zypper install python-mysql