Friday, May 13, 2011

How I got Cassandra stress.py to work

I am using debian squeeze and already had cassandra running from the debian packages. If you are on a different distribution, you mileage may vary.

Get Cassandra source (current version 0.8.0~beta2)
svn co http://svn.apache.org/repos/asf/cassandra/tags/cassandra-0.8.0-rc1/ cassandra

Get needed packages to build Thrift (all on one line)
apt-get -y install libboost-dev python-dev autoconf automake pkg-config make libtool flex bison build-essential ant subversion

Get Thrift (must be version 0.6.0 wiht 0.8.0~beta2 cassandra)
svn co http://svn.apache.org/repos/asf/thrift/tags/thrift-0.6.0/ thrift

Now compile Thrift
cd thrift
./bootstrap.sh
./configure (you may need to add --without-ruby or --without-csharp or any other targets that are giving you trouble)
make
make install (MUST BE ROOT! SU or SUDO)

Now make the python libraries
cd ~/thrift/lib/py
python setup.py install

Change directory to Cassandra source
cd ~/cassandra

Now compile thrift for python (I think this is why)
ant gen-thrift-py

Change directory to the python stress directory
cd ~/cassandra/tools/py_stress

Cross your fingers and run it!
python stress.py --num-keys 1000000 --threads 8 --keep-going

No comments: