Installing HandlerSocket on RHEL 6 + Percona-Server 5.5 in Five(ish) Easy Steps
As a followup to my previous post on installing HandlerSocket on CentOS 5 + Percona-Server 5.1, I’ve been asked to provide an updated HOWTO for RHEL 6 + Percona-Server 5.5. Although very similar to the original steps, there are some new traps (RHEL 6 comes with SELinux enabled) and there are some new ec2 gotchas!
[OPTIONAL] 0 – Prepare the ec2 instance
If you’re doing this on an ec2 instance, you’ll need to follow the steps outlined at the Major Red Hat Enterprise Linux AMI Update Announcement
1 – Set up the Percona Yum Repository
%> rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm
Additional documentation for other distributions and architectures can be found at http://www.percona.com/docs/wiki/repositories:start
2 – Install Percona-Server Packages
%> yum install Percona-Server-client-55 Percona-Server-devel-55 Percona-Server-server-55 Percona-Server-shared-55 Percona-Server-shared-compat
[OPTIONAL] 2.5 – Play nicely with SELinux
If SELinux is running (and you can test this as follows):
%> sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
If SELinux status = enabled, then you’ll need this step. Otherwise, skip to step 3.
Allow for mysqld to listen on ports 9998 and 9999 (note that these ports must match those used in step 3):
%> yum install policycoreutils-python
%> semanage port -a -t mysqld_port_t -p tcp 9998
%> semanage port -a -t mysqld_port_t -p tcp 9999
And then restart mysqld:
%> service mysql restart
3 – Enable the PlugIn in my.cnf by adding the following lines in [mysqld]:
loose_handlersocket_port = 9998
loose_handlersocket_port_wr = 9999
loose_handlersocket_threads = 16
loose_handlersocket_threads_wr = 1
open_files_limit = 65535
4 – Install the PlugIn
mysql> install plugin handlersocket soname 'handlersocket.so';
5 – Verify
The easiest way to verify that HandlerSocket is running is to simply telnet to ports 9998 and 9999 on the localhost.
External Documentation
