%BOOK_ENTITIES; ]>
Install the Database on a Separate Node This section describes how to install MySQL on a standalone machine, separate from the Management Server. This technique is intended for a deployment that includes several Management Server nodes. If you have a single-node Management Server deployment, you will typically use the same node for MySQL. See . The management server doesn't require a specific distribution for the MySQL node. You can use a distribution or Operating System of your choice. Using the same distribution as the management server is recommended, but not required. See . Install MySQL from the package repository from your distribution: On RHEL or CentOS: yum install mysql-server On Ubuntu: apt-get install mysql-server Edit the MySQL configuration (/etc/my.cnf or /etc/mysql/my.cnf, depending on your OS) and insert the following lines in the [mysqld] section. You can put these lines below the datadir line. The max_connections parameter should be set to 350 multiplied by the number of Management Servers you are deploying. This example assumes two Management Servers. On Ubuntu you can also create a file /etc/mysql/conf.d/cloudstack.cnf and add these directives there. Don't forget to add [mysqld] on the first line of the file. innodb_rollback_on_timeout=1 innodb_lock_wait_timeout=600 max_connections=700 log-bin=mysql-bin binlog-format = 'ROW' bind-address = 0.0.0.0 On RHEL/CentOS MySQL doesn't start after installation, start it manually. service mysqld start On RHEL and CentOS, MySQL does not set a root password by default. It is very strongly recommended that you set a root password as a security precaution. Run the following commands, and substitute your own desired root password. This step is not required on Ubuntu as it asks for a root password during installation. Run this command to secure your installation. You can answer "Y" to all questions except to "Disallow root login remotely?". This is required to set up the databases. mysql_secure_installation If a firewall is present on the system, open TCP port 3306 so external MySQL connections can be established. On RHEL/CentOS: Edit the /etc/sysconfig/iptables file and add the following line at the beginning of the INPUT chain. -A INPUT -p tcp --dport 3306 -j ACCEPT Now reload the iptables rules. service iptables restart On Ubuntu: UFW is the default firewall on Ubuntu, open the port with this command: ufw allow mysql Set up the database. The following command creates the cloud user on the database. This command should be run on the first Management server node! In dbpassword, specify the password to be assigned to the cloud user. You can choose to provide no password. In deploy-as, specify the username and password of the user deploying the database. In the following command, it is assumed the root user is deploying the database and creating the cloud user. (Optional) For encryption_type, use file or web to indicate the technique used to pass in the database encryption password. Default: file. See About Password and Key Encryption. (Optional) For management_server_key, substitute the default key that is used to encrypt confidential parameters in the &PRODUCT; properties file. Default: password. It is highly recommended that you replace this with a more secure value. See About Password and Key Encryption. (Optional) For database_key, substitute the default key that is used to encrypt confidential parameters in the &PRODUCT; database. Default: password. It is highly recommended that you replace this with a more secure value. See About Password and Key Encryption. cloud-setup-databases cloud:<dbpassword>@<ip address mysql server> \ --deploy-as=root:<password> \ -e <encryption_type> \ -m <management_server_key> \ -k <database_key> When this script is finished, you should see a message like “Successfully initialized the database.”