Waffle Grid quick install tutorial

Yesterday we announced what the Waffle Grid project is.  Some people ignored it, others I am sure read it with curiosity, but i figure their is a small subset of folks out their who said: “WOW!!!  That is really cool.  I want a Waffle Grid now!”… I wonder if these are the same people who run out and buy the latest SSD harddrive because its fast and the latest nvidia card because they can one up all their friends…  To those who want it now, but do not know where to begin I let me give you a quick install tutorial.  Some of this already exists on the wiki, but hopefully I will make it clearer here.

Get two servers….  I will wait.


Ok back?   Super.

Your going to need memcached installed somewhere…    You can download it from http://www.danga.com/memcached/ , if you never installed it before you should look around and see what it is all about.  You will also need to grab the libevent package which you can grab here:  http://www.monkey.org/~provos/libevent/ … or for those who are too lazy or too time constrained to grab the source, apt-get install memcached or yum install memcached depending on your linux distro should do the trick.

We make use of libmemcached, so go grab libmemcached (http://tangent.org/552/libmemcached.html)

Compile and install libmemcached. For decent performance (200x increase with 16k block), edit libmemcached/memcached_constants.h and rise MEMCACHED_MAX_BUFFER to 16500.

Grab the MySQL 5.1 source and put it out on your server.  We have only been testing against the 5.1 branch, feel free to try with another version, but I make no promises.

The patch is out on launchpad, if you have never used launchedpad their are plenty of decent resources out their to help you with this one.   Grab the patch, look find the most recent one at https://code.launchpad.net/~y-trudeau/wafflegrid/main.

Unpack the source and apply the Patch to it.

*** Hint, will look something like this:  ***

root@yves-laptop:/opt# cd mysql-5.1.29-rc/storage/innobase/
root@yves-laptop:/opt/mysql-5.1.29-rc/storage/innobase# cat /opt/memc-mysql-5.1.29-20081117.patch | patch -p0
patching file /opt/mysql-5.1.29-rc/storage/innobase/buf/buf0lru.c
patching file /opt/mysql-5.1.29-rc/storage/innobase/buf/buf0rea.c
patching file /opt/mysql-5.1.29-rc/storage/innobase/include/thr0loc.h
patching file /opt/mysql-5.1.29-rc/storage/innobase/thr/thr0loc.c
Add your memcached servers prior to compiling:

cd /mysql-5.1.29-rc/storage/innobase/buf

IN buf0lru.c & buf0rea.c change:

char mcservername[]= "localhost";

to :

char mcservername[]= ",,,";

Compile mysql with the patch. You need to add the memcached library to the build script. See here for 32 bit compile-pentium-max-memc and here for 64bit compile-pentium64-max-memc.


Fire up memcached on your remote machines:

/usr/bin/memcached -m 1400 -p 11211 -u nobody -d

Setup MySQL as you normally would, and start it up.

You can monitor the hits in memcache with memstat -s SERVER_IP …


This entry was posted in mysql, Waffle Grid. Bookmark the permalink.