Some of us might not having much time in installing and configuring several servers which run in a database cluster. As you can refer to my previous posts which related to installation of MySQL Galera and Percona XtraDB Cluster, it always required to spend 1 or 2 hours to do the installation and configuration.
Severalnines provide a super-great tool to install, configure and monitor the MySQL cluster. Basically, you just need to go to their website, follow the configuration wizards and they will create an installer script. What you just need is several servers ready with basic networking. 4 minimum servers are required; 3 will be running MySQL Galera cluster and another host used to run ClusterControl which will do all the automation work for you including installation, configuration and monitoring.
I will use the latest CentOS 6.3 64bit in this post, even though they do not mention if it is supported yet. I already tested in its working as expected. You may refer to architecture that I used to install as below:
Preparing the Servers
Make sure /etc/hosts for all server are having the same value as below:
192.168.0.221 galera1 galera1.local 192.168.0.222 galera2 galera2.local 192.168.0.223 galera3 galera3.local 192.168.0.230 clustercontrol clustercontrol.local
Disable SELINUX completely in all servers:
$ sed -i.bak 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
Generate Deployment Script
1. Go to Severalnines.com Galera configurator website here: http://www.severalnines.com/galera-configurator/
2. Choose “Codership’s release (based on MySQL 5.5)” and click Next. Start configuring your servers under General Settings as below:
Cloud Provider : none/on-premise Operating System : RHEL6 - Redhat 6.2/Fedora/Centos 6.2/OLN 6.2 Platform : Linux 64-bit (x86_64) Number of Galera Servers : 3+1 MySQL PortNumber : 3306 Galera PortNumber : 4567 Galera SST PortNumber : 4444 SSH PortNumber : 22 OS User : root MySQL Server password (root user): BTrHs87cE CMON DB password (cmon user) : VfjLs12yz Firewall (iptables) : disable
3. Click Next. Under Configure Storage tab, enter respective information as example below:
System Memory (MySQL Servers): 512MB WAN : no Skip DNS Resolve : yes Database Size : <8GB MySQL Usage : Medium write/high read Number of cores : 2 innodb_buffer_pool_size : (auto configured) innodb_file_per_table : Checked
4. Click Next. Under Configure Directories tab, enter respective information as example below:
5. Click Next. Under Review Config tab, enter respective information as example below:
6. On the final page, you need to take note on the URL of the deployment script so we can use it to download directly into our server:
Deploy the Cluster
1. Login via console or SSH to the ClusterControl server which is 192.168.0.230 and download the deployment script:
$ cd /usr/local/src $ wget http://www.severalnines.com/galera-configurator/tmp/r18g0ggko1svcaje8ude7gjmm4/s9s-galera-2.1.0-rpm.tar.gz $ tar -xzf s9s-galera-2.1.0-rpm.tar.gz
2. Navigate to the installer and start the deployment process:
$ cd s9s-galera-2.1.0-rpm/mysql/scripts $ ./deploy.sh 2>&1 |tee cc.log
3. Answer few questions, example as below:
Redhat/Centos/Fedora detected - do you want to set SELinux to Permissive mode. ** IF YOU HAVE SELinux == disabled ON ALL HOSTS PRESS 'n' AND IGNORE THE WARNING. ** (you can set SELinux to Enforcing again later if you want) - 'y' is recommended (y/n): n Can you SSH from this host to all other hosts without password? Choosing 'n' will allow you to setup shared keys. (y/n): n
Your cluster will be ready within few minutes. Once completed, it will notify you the ClusterControl URL. This is the monitoring tools which integrated seamlessly into the MySQL Galera cluster deployment.
1. Before we connect to the ClusterControl, we need to install certain things like JpGraph so we can view graph correctly. As refer to the support page here, http://support.severalnines.com/entries/20978841-jpgraph-installation. Download JpGraph at this website, http://jpgraph.net/download/:
$ tar xvfz jpgraph-3.5.0b1.tar.gz -C /var/www/html/cmon $ cd /var/www/html/cmon $ ln -s jpgraph-3.5.0b1 jpgraph $ chown apache:apache -R jpgraph*
2. Start the crond service so the RRDtool graph works correctly:
$ chkconfig crond on $ service crond start
3. Lets connect to the ClusterControl. Open web browser and go to http://192.168.0.230/cmon/setup.php. In this page, we are required to enter the CMON password:
4. Click “Test the connection and save config data“. You will then should be redirected to the Dashboard page as below:
Done! Your MySQL Galera Cluster is running perfectly with monitoring, configuring and alerting system. As you can see in the screenshot above, the “Host Alarms” has found out the server’s RAM usage is in critical (96% usage). It even give you some advise on how to solve the problem. Isn’t this helpful?
Considering the easiness on deploying this cluster without added cost, you are now having one of the most complete MySQL Galera Cluster suite!