Friday, April 16, 2010
Getting cassandra up to hit with ruby and C++ clients
So at Discovereads we're giving cassandra a spin on the dance floor to see how she moves. We also need to connect via ruby and C++ clients (most of our writing will come from C++ and mostly reading (though some writing as well) from the ruby).
Seems everyone has a blog post like this one where he or she says "it took forever, kept looking at other sites and none of them just worked, so hopefully I'll save someone else some time and put the steps I took here". Well, this is mine. Pretty skeptical it'll actually help anyone else, but I hope it does!
I got a lot of help (on the ruby side) from http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/
And after accomplishing hitting from the ruby client I moved on to trying to hit with the libcassandra lib from posulliv: http://posulliv.github.com/2010/02/22/cpp-cassandra.html , http://github.com/posulliv
First, get cassandra (the ruby way), following evan weaver's instructions (link above)
Now, to get the C++ lib working, there were a few unsatisfied dependencies:
- boost (I used 1.4.2.0): http://sourceforge.net/projects/boost/files/boost/1.42.0/
- thrift (I used thrift 0.2.0): http://incubator.apache.org/thrift/download/
Cassandra C++ lib
get boost:
Seems everyone has a blog post like this one where he or she says "it took forever, kept looking at other sites and none of them just worked, so hopefully I'll save someone else some time and put the steps I took here". Well, this is mine. Pretty skeptical it'll actually help anyone else, but I hope it does!
I got a lot of help (on the ruby side) from http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/
And after accomplishing hitting from the ruby client I moved on to trying to hit with the libcassandra lib from posulliv: http://posulliv.github.com/2010/02/22/cpp-cassandra.html , http://github.com/posulliv
First, get cassandra (the ruby way), following evan weaver's instructions (link above)
Now, to get the C++ lib working, there were a few unsatisfied dependencies:
- boost (I used 1.4.2.0): http://sourceforge.net/projects/boost/files/boost/1.42.0/
- thrift (I used thrift 0.2.0): http://incubator.apache.org/thrift/download/
Cassandra C++ lib
get boost:
- tar xzf boost_1_42_0.tar.gz
- cd boost_1_42_0
- ./bootstrap.sh
- ./bjam
- sudo ./bjam install --prefix=/usr/local (i think i'm being redundant with the /usr/local but oh well)
- tar xzf thrift-0.2.0-incubating.tar.gz
- cd thrift-0.2.0
- (note: i was getting desperate when encountering errors so installed libevent (sudo port libevent) in here, but i don't think it was necessary for thrift to install. so skip this and see if everything still works....)
- quick check of autoconf version:
- autoconf -V (note the capital "V")
- if version is 2.61 you're fine otherwise, see http://wiki.apache.org/thrift/ThriftInstallationMacOSX and try to figure something out
- ./configure
- make
- sudo make install
- git clone git://github.com/posulliv/libcassandra.git
- cd libcassandra
- ./config/autorun.sh
- ./configure
- make
- It was complaining about about variodic macros and C99, so i went into the Makefile and removed the two instances of -Werror. yes, total hack, but it did compile.
- sudo make install