Galera 1.0 is here, Severalnines support, more to come
There are moments in history that become like signpost that everyone remembers the rest of their lives. Like where were you when you heard the news that JFK had been shot, or those 9/11 planes hit the WTC twin towers. If you work with MySQL and high-availability, then this week will be remembered as such. And if you're a European MySQL geek, you will remember that we were at the Percona Live UK conference when Galera clustering 1.0 was announced. Btw, the conference itself was also historical, at least for European MySQL users. I will have to write a separate blog post about the conference, because it was a great one, and I have to post slides of my 2 talks too. But this blog post is dedicated to the stable release of Galera.
I've often compared the arrival of Galera with how the process of MySQL backups has changed in the past year. In the past you had various alternatives to do MySQL backups: Mysqldump is good in many ways but impractical with anything but small databases; You can take a raw copy of the MySQL files, but then you need to lock or shutdown your database, which hasn't really been an option for any online service the last 10 years; You can use and additional slave as a dedicated backup server to avoid downtime; Or you could use one of a few online or near-online proprietary solutions. And then Percona created Xtrabackup, which is open source, takes online backups, incremental backups with minimal overhead. It's just the right way of taking backups, the problem is solved, and the discussion and the focus of community moves to other topics.
Galera is the same solution for the question of high-availibility. There are many high-availability solutions out there. Most MySQL users are currently using MySQL replication, which is simple to setup, has fast failovers, carries a risk of losing data and can be a bit brittle just in general. Some use DRBD and SAN based solutions which guarantee no data loss but come with a performance penalty and failover times that can be counted in minutes. There are many clustering solutions out there, some incomprehensibly complex, some brittle. And now we have Galera: simple to setup, no slave lag, no data loss, zero failover time. Say good buy to choosing between trade-offs, this is the optimal solution, no compromises needed.
I tested Galera for about 6 weeks during the past Summer. Already the pre-release versions were stable, and performed well in my benchmarks. I wrote several blog posts about those tests. A summary of the results is also in my slides from the Percona Live talk, which I will post soon. Beyond that, you can read Seppo's blog announcing the 1.0 release.
Simultaneously with Codership releasing Galera 1.0, also Severalnines released an adaptation of their product with Galera support: ClusterControl for Galera.
What can I say, it's like when your two best friends get married. And you remember when they first met at your party or something...
ClusterControl was first known just as "the Severalnines scripts" created by Johan Andersson. Until this year they just known for making life enjoyable for users of MySQL Cluster, but during this year Johan, Vinay and JJ have built a real company and the scripts have grown to a proper product branded as ClusterControl. As of this week ClusterControl now supports the full suite of MySQL Cluster, MySQL replication based clusters and Galera clusters. It's truly amazing progress for just one year!
And btw, Johan's background with MySQL Cluster shows: Also with MySQL replication, ClusterControl will set you up to use a pair of masters using semi-synchronous replication. Of these three alternatives it's still the poorest alternative of the three available, but at least it helps protect against data loss by actually supporting semi-synchronous. I think all other clustering solutions out there are still fiddling around with the classic asynchronous MySQL replication.
When I've used the Severalnines scripts for MySQL Cluster, the benefit of using them was obvious: MySQL Cluster is quite difficult to configure right, so going through Johan's configurator tool was a sure bet for getting an optimal configuration for your hardware. The other big win was the ease of deployment: Instead of creating SSH connections to anything between 3 to 8 hosts, then installing data nodes, mysql nodes and management nodes and starting them in the right order, you could just say "deploy.sh" from one location and watch the deployment script doing all that work for you.
I had a change to test a pre-release of ClusterControl for Galera. I had my doubts about it to be honest. Galera is much easier to configure than the NDB engine, it is just good old InnoDB. It is easier than MySQL replication, you don't have to mess around with filenames and byte offsets, Galera can figure out that by itself. Heck, when deploying new nodes, it will even copy the database transparently, you don't need to do the backup procedure you do with MySQL replication. So the question was, can a tool like ClusterControl add any value since Galera is so simple as it is?
The answer is, yes it can! Sure, Galera is easy to setup, but ClusterControl makes it easier still. After you go through the web-based configurator, you just login to one host only, you do one single command only and 5 minutes later you have a Galera cluster running on 3 or more nodes. The main value of Severalnines ClusterControl is still there: You don't need to log in and repeat the installation on every single host. (It's important to note that not only is doing that boring, it is also a common source for introducing manual errors. By automating the whole installation, ClusterControl makes it deterministic. This is, to be trendy, DevOps in a nice package for you.)
And just like with the original Severalnines scripts, you get an optimal configuration with the package. The web-based configurator asks you for amount of memory and number of cores, and there you go! Your configuration is tuned by Johan from Severalnines and Alex from Codership, can it get any better? Well yes it can, because I gave some feedback too, but I think now it is close to perfect :-) But anyway, if you just want to test Galera with a good configuration, and don't want to learn anything at all about configuring it, this is a great tool for you.
In fact, the simplicity of Galera makes also the ClusterControl configurator simpler. When I tried it, there was a section asking whether you wanted to use innodb_flush_log_at_trx_commit with a value of 0 or 1 or 2, trying to explain the significance of choosing one or the other. It was also asking whether you use large blobs, a curiosity when configuring the NDB storage engine. With Galera both of these questions could be removed (you can just set innodb_flush_log_at_trx_commit=2 and your data is still safe thanks to true synchronous replication) and the configuration is now really simple. It basically asks you the IP addresses where to install the cluster, it can't get simpler than this.
Here's some output from my test run a couple days ago, just to show you how easy it is to run clusters nowadays:
[user@host128lab ~]$ tar xvzf s9s-galera-1.0.0-rpm\(4\).tar.gz
[user@host128lab ~]$ cd s9s-galera-1.0.0-rpm/mysql/scripts/install/
[user@host128lab install]$ nano .s9s/config
[user@host128lab install]$ ./deploy.sh
trying to ssh_keyscan xxx.xx.xxx.22: [ok]
trying to ssh_keyscan xxx.xx.xxx.23: [ok]
trying to ssh_keyscan xxx.xx.xxx.24: [ok]
trying to ssh_keyscan xxx.xx.xxx.25: [ok]
Can you SSH from this host to all other hosts without password?
Choosing 'n' will allow you to setup shared keys. (y/n - default 'n'):
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/n - default 'y'):
Installing with current SELinux setting - if that is ENFORCING, the installation may fail.
Symptoms will be
- failure to connect to MySQL Servers
- failure to start Cluster
- on CENTOS 6 there is a bug: http://bugs.centos.org/print_bug_page.php?bug_id=4959
Do you want to uninstall previously installed RPMs that this package will install? (y/n - default 'y'):
Severalnines: Uninstalling RPMs
Severalnines: Uninstalling RPMs for mysql servers
Severalnines: Uninstalling RPMs on xxx.xx.xxx.22
xxx.xx.xxx.22: Executing 'killall -9 cmon mysqld'[ok]
xxx.xx.xxx.22: Executing 'rpm -e mysql'[ok]
xxx.xx.xxx.22: Executing 'rpm -e mysql-client'[ok]
xxx.xx.xxx.22: Executing 'rpm -e mysql-libs'[ok]
xxx.xx.xxx.22: Executing 'rpm -e mysql-server'[ok]
...869 lines, 7 minutes and 47 seconds later...
xxx.xx.xxx.24: Executing 'chmod 755 /etc/init.d/cmon' [ok]
xxx.xx.xxx.24: Executing '/sbin/chkconfig --add cmon' [ok]
xxx.xx.xxx.24: Executing '/etc/init.d/cmon restart'[ok]
Stopping cmon : ok
Starting cmon --config-file=/etc/cmon.cnf : ok
galera : xxx.xx.xxx.22 [ up]
galera : xxx.xx.xxx.23 [ up]
galera : xxx.xx.xxx.24 [ up]
Installation completed in 467 seconds
* CONGRATULATIONS *
You have now installed one of the most advanced infrastructures available.
Also, have a look at ClusterControl, our monitoring and management tool.
Point your browser to http:///cmon
Don't hesitate to contact us if you have any problems or inquiries. Good luck,
Severalnines also posted a Galera tutorial. This is actually quite good summary of what Galera is about and why it works so great.
The Codership team seemed to be quite busy in London, running from one customer or partner meeting to another. Chances are there is more to come soon, same bat time, same bat channel.
Once again, congratulations to both Codership and Severalnines teams for these historical releases!