Skip to content

Instantly share code, notes, and snippets.

@wearethefoos
Created June 5, 2013 07:42
Show Gist options
  • Select an option

  • Save wearethefoos/5712252 to your computer and use it in GitHub Desktop.

Select an option

Save wearethefoos/5712252 to your computer and use it in GitHub Desktop.

Percona and Rails

From the Percona site:

Percona XtraDB Cluster is a high availability and high scalability solution for MySQL users. Percona XtraDB Cluster integrates Percona Server with the Galera library of high availability solutions in a single product package. Percona XtraDB Cluster enables users to save money through:

  • Less downtime and higher availability
  • Reduced investment in high availability architectures
  • Lower DBA training and education costs
  • No investment in third-party, high availability solutions

Percona XtraDB Cluster features include:

  • Synchronous replication
  • Multi-master replication support
  • Parallel replication
  • Automatic node provisioning
  • The focus for Percona XtraDB Cluster is data consistency at a significantly lower total cost than existing high availability solutions. It may be especially useful if your organization currently:

Uses MySQL replication to ensure high availability Needs a high availability solution for MySQL deployed in the cloud Is looking for a new, novel way to address previously impossible high availability challenges

Doesn't that sound great?

I thought so. At Springest we use MySQL, so I wanted to try this out at once.

Installing Percona Server with Homebrew

$ brew install percona-server

That was easy :) Not so fast! I had mysql installed through Homebrew, but percona-server and mysql conflict with each other due to shared libraries and different versions. Thus:

$ brew uninstall mysql && brew install percona-server

Awesome! Following the info after installation I started Percona with the included launchctl script, and... all my databases were still there! <3

Cd'ed into my app, I tried a bundle exec rails c, but the mysql2 gem I had installed was compiled against a different version, so I had to recompile it. I use Rbenv, so I just threw out my gemset and reinstalled the complete bundle.

$ rbenv delete 1.9.3-p194-perf springest
$ gem install bundler
$ bundle install

Rvm has the same kind of feature:

$ rvm gemset empty springest

If you use a system-wide gem installation, you could do:

$ [sudo] gem uninstall mysql2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment