After successfully installing thrift there are still a string of dependencies needed before you can install ThruDB.
Thanks in no small part to Jake Luciani for helping me with finding the dependencies.
First we need several packages from the macports. You may want to run sudo port selfupdate to get the latest versions of those packages.
sudo port install boost clucene libevent memcached ossp-uuid
I hit a weird compile error on boost. I fixed it by running sudo port clean boost and simply re-running the port install command. Same problem on both my machines.
Like mentioned above, we need facebook’s thrift. We will their public SVN version because this fixes a bug which makes compiling on OSX easier.
svn co http://svn.facebook.com/svnroot/thrift/trunk/ thrift cd thrift; ./bootstrap.sh ./configure --with-boost=/opt/local --with-libevent=/opt/local --prefix=/opt/local sudo make install
Don’t forget to install the thrift ruby libraries:
cd thrift/lib/rb ruby setup.rb
Next we need spread. Spread is a message bus which works much like you imagine a network of IRC server to work. ThruDB uses it for replication and two-phase commits amongst other things. Its a remarkable piece of software which should find its way in most server farms, regardless of ThruDB’s use or not. Once common usecase is to broadcast server logs to spread. This allows you to write a simple client which just listens to the messages and calculates user statistics, traffic and so on. Its also great for replication and keeping multiple systems in sync, such as a search server and the main database.
Unfortunately the spread team decided that everyone who wants to install it has to fill out a quick form so you will have to manually download it from http://www.spread.org/download/spread-src-4.0.0.tar.gz.
tar zxf spread-src-4.0.0 ./configure --prefix=/opt/local make sudo make install
ThruDB makes heavy usage of memcached, therefore it uses the up-and-coming c library by Brian Aker which is quickly establishing itself as the defacto standard client implementation due to its speed and use of Consistent Hashing. I actually wrote a ruby extension for this client library with some very encouraging performance metrics. I hope to release this soon.
curl http://download.tangent.org/libmemcached-0.12.tar.gz > libmemcached-0.12.tar.gz tar zxf libmemcached-0.12.tar.gz cd libmemcached-0.12 ./configure --prefix=/opt/local sudo make install
Lastly there is log4cxx to be installed. This is a pretty heavy library because of its use of apache apr. Jake said that he may dump it in an upcoming release to make the dependencies of ThruDB a bit more sane.
svn checkout http://svn.apache.org/repos/asf/logging/log4cxx/trunk apache-log4cxx cd apache-log4cxx ./autogen.sh ./configure --prefix=/opt/local sudo make install
svn co http://thrudb.googlecode.com/svn/trunk thrudb cd thrudb; ./autogen.sh env LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/lib -I/opt/local/include -I/opt/local/include/thrift" ./configure --prefix=/opt/local sudo make install
If the compile fails with a missing thriftnb library than you didn’t compile thrift with—with-libevent=/opt/local . Just do that again, we’ll wait.
# Run memcached server memcached -d # Setup lib shenanigans export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib/ #run thrudb tutorials cd tutorial # create the ruby client for the bookmarks.thrift service make # start thrudb ./thrudbctl start # run the tutorial cd rb; ruby BookmarkExample.rb # Profit! (to quote Jake)
After successfully installing thrift there are still a string of dependencies needed before you can install ThruDB.
Thanks in no small part to Jake Luciani for helping me with finding the dependencies.
First we need several packages from the macports. You may want to run sudo port selfupdate to get the latest versions of those packages.
sudo port install boost clucene libevent memcached ossp-uuid
I hit a weird compile error on boost. I fixed it by running sudo port clean boost and simply re-running the port install command. Same problem on both my machines.
Like mentioned above, we need facebook’s thrift. We will their public SVN version because this fixes a bug which makes compiling on OSX easier.
svn co http://svn.facebook.com/svnroot/thrift/trunk/ thrift cd thrift; ./bootstrap.sh ./configure --with-boost=/opt/local --with-libevent=/opt/local --prefix=/opt/local sudo make install
Don’t forget to install the thrift ruby libraries:
cd thrift/lib/rb ruby setup.rb
Next we need spread. Spread is a message bus which works much like you imagine a network of IRC server to work. ThruDB uses it for replication and two-phase commits amongst other things. Its a remarkable piece of software which should find its way in most server farms, regardless of ThruDB’s use or not. Once common usecase is to broadcast server logs to spread. This allows you to write a simple client which just listens to the messages and calculates user statistics, traffic and so on. Its also great for replication and keeping multiple systems in sync, such as a search server and the main database.
Unfortunately the spread team decided that everyone who wants to install it has to fill out a quick form so you will have to manually download it from http://www.spread.org/download/spread-src-4.0.0.tar.gz.
tar zxf spread-src-4.0.0 ./configure --prefix=/opt/local make sudo make install
ThruDB makes heavy usage of memcached, therefore it uses the up-and-coming c library by Brian Aker which is quickly establishing itself as the defacto standard client implementation due to its speed and use of Consistent Hashing. I actually wrote a ruby extension for this client library with some very encouraging performance metrics. I hope to release this soon.
curl http://download.tangent.org/libmemcached-0.12.tar.gz > libmemcached-0.12.tar.gz tar zxf libmemcached-0.12.tar.gz cd libmemcached-0.12 ./configure --prefix=/opt/local sudo make install
Lastly there is log4cxx to be installed. This is a pretty heavy library because of its use of apache apr. Jake said that he may dump it in an upcoming release to make the dependencies of ThruDB a bit more sane.
svn checkout http://svn.apache.org/repos/asf/logging/log4cxx/trunk apache-log4cxx cd apache-log4cxx ./autogen.sh ./configure --prefix=/opt/local sudo make install
svn co http://thrudb.googlecode.com/svn/trunk thrudb cd thrudb; ./autogen.sh env LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/lib -I/opt/local/include -I/opt/local/include/thrift" ./configure --prefix=/opt/local sudo make install
If the compile fails with a missing thriftnb library than you didn’t compile thrift with—with-libevent=/opt/local . Just do that again, we’ll wait.
# Run memcached server memcached -d # Setup lib shenanigans export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib/ #run thrudb tutorials cd tutorial # create the ruby client for the bookmarks.thrift service make # start thrudb ./thrudbctl start # run the tutorial cd rb; ruby BookmarkExample.rb # Profit! (to quote Jake)