Thrift is an open-source Apache project used to implement communication between different languages. Programming LanguageTo operate Cassandra, thrift is required.
Unfortunately, UBUNTU cannot use apt-get to install thrift, so you need to compile it manually.
Compiling environment: Ubuntu 8.10 (8.04 libtool package is not available)
Install necessary packages first
Sudo apt-Get install build-essential
Sudo apt-Get install bison flex
Sudo apt-Get install libboost-dev Python-Dev
Sudo apt-Get install Autoconf automake libtool PKG-config
Sudo apt-Get install git
Download the thrift source code package and compile and install it.
Wget http://labs.renren.com/apache-mirror/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
Tar xf thrift-0.2.0-incubating.tar.gz
D thrift-0.2.0
./Configure
Make
Sudo make install
Installed successfully,
Test Using Python
CD tutorial
Thrift -- Gen py thrift. Thrift
Thrift -- Gen py shared. Thrift
Cp py/* gen-py
CD gen-py
Python pythonserver. py &
Python pythonclient. py