Installing Percona 5.1 on Centos 5
I recently moved several peripheral machines to using the Percona builds of MySQL with their XtraDB storage engine. I picked up more interest around their products after attending their conference in NYC a couple weeks ago.
The performance difference is substantive and easily seen in the various benchmarks I’ve done. The Percona build hits a higher transactions/sec peak and holds out longer before InnoDB/XtraDB starts thrashing on significant concurrency. I also like knowing there is a support structure in place should it be needed that doesn’t involve talking to Oracle.
Though not yet battle tested, I believe overall it will be a good move and their stuff is certainly worth a look if you are exploring options with MySQL. They have lots of nice, tested adjustments in the code and bake in the cool addons you read about (HandlerSocket, FlashCache, XtraBackup, etc) plus you know you are working with all the latest good stuff in the InnoDB Plugin as all of that is included in the base Percona install. It’s a drop in replacement so replication, mmm, mytop, and all the other tools you are used to work just fine.
But, their packaging and installation is fairly rough. Right now 7 of the most recent 10 posts in their forum are about package incompatibilities and broken installations across Centos and Ubuntu and there isn’t much help to be found from the staff there.
Here’s how I got 5.1 to install on Centos 5.5 machines (where stock 5.0 is the default package) such that I could still install other packages like mytop that depended on a 5.0 shared library . I hate having to force packages in directly outside the package manager but couldn’t find another way given their packages collide with one another. We’re basically forcing in the shared-compat package and then forcing the shared package we want in on top of that. This was to upgrade an existing stock MySQL server.
- Backup your data completely and shove it in a safe place just in case, then as root:
$/etc/init.d/mysqld stop$rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm$yum remove mysql-server mysql mysql-devel mysql-test mysql-bench(you may not have all of these)$yum install Percona-Server-server-51 Percona-Server-client-51- The server will be started if install finishes and there are no issues, kill it with
/etc/init.d/mysql stopif this is the case.
- The server will be started if install finishes and there are no issues, kill it with
$ln -s /etc/init.d/mysql /etc/init.d/mysqld(preference thing, but this way it matches the Centos init script name)$yum install Percona-SQL-shared-compat-5.1.42-2.x86_64- This will error out but will leave the rpm we want in yum’s cache.
$rpm -Uvh /var/cache/yum/percona/packages/Percona-SQL-shared-compat-5.1.43-2.x86_64.rpm --force$yum remove Percona-Server-shared-51$yum install Percona-Server-shared-51- This will error out but will leave the rpm we want in yum’s cache.
$rpm -Uvh /var/cache/yum/percona/packages/Percona-Server-shared-51*.rpm --force
That should get things installed so try starting mysql back up and watch /var/log/mysqld.log for any errors. You may have old cruft in your 5.0 my.cnf file that is not compatible with 5.1.
Assuming it does start back up you will want to complete the upgrade:
- Run a
mysql_upgrade - Run a
mysqlcheck -A --check-upgradeto make sure everything checks out. If you get messages containing “Table upgrade required” for some of your InnoDB tables manually fix them withalter table MY_TABLE engine=InnoDB.
That should wrap things up. No guarantees but this is what worked for me.