- Install MySQL from the package repository of your distribution:
sudo aptitude install mysql-server
- Create a file /etc/mysql/conf.d/cloudstack.cnf.
sudo nano /etc/mysql/conf.d/cloudstack.cnf
[mysqld]
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'
- Start or restart MySQL to put the new configuration into effect.
sudo service mysql restart
- Set up the database. The following command creates the “cloud” user on the database.
- In dbpassword, specify the password to be assigned to the “cloud”
user. You can choose to provide no password although that is not
recommended.
- 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 CloudStack
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 CloudStack
database. Default: password. It is highly recommended that you
replace this with a more secure value. See
About Password and Key Encryption.
- (Optional) For management_server_ip, you may explicitly specify
cluster management server node IP. If not specified, the local IP
address will be used.
cloudstack-setup-databases cloud:${dbpassword}@${ip address mysql server} \
--deploy-as=root:${password} \
-e ${encryption_type} \
-m ${management_server_key} \
-k ${database_key} \
-i ${management_server_ip}
Mysql user name:cloud [ OK ]
Mysql user password:****** [ OK ]
Mysql server ip:127.0.0.1 [ OK ]
Mysql server port:3306 [ OK ]
Mysql root user name:root [ OK ]
Mysql root user password:****** [ OK ]
Checking Cloud database files ... [ OK ]
Checking local machine hostname ... [ OK ]
Checking SELinux setup ... [ OK ]
Detected local IP address as 192.168.180.3, will use as cluster management server node IP[ OK ]
Preparing /etc/cloudstack/management/db.properties [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/server-setup.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/templates.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_db.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_schema.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_multipart.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_index.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_multipart_alter.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_bucketpolicy.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_policy_alter.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_offering.sql [ OK ]
Applying /usr/share/cloudstack-bridge/setup/cloudbridge_offering_alter.sql [ OK ]
Processing encryption ... [ OK ]
Finalizing setup ... [ OK ]
CloudStack has successfully initialized database, you can check your database configuration in /etc/cloudstack/management/db.properties
- If you are running the KVM hypervisor on the same machine with the Management Server, edit /etc/sudoers and add the following line:
Defaults:cloud !requiretty
- Now that the database is set up, you can finish configuring the OS for the Management Server. This command will set up iptables, sudoers, and start the Management Server.
sudo cloudstack-setup-management
Starting to configure CloudStack Management Server:
Configure sudoers ... [OK]
Configure Firewall ... [OK]
Configure CloudStack Management Server ...[OK]
CloudStack Management Server setup is Done!