Thrift是Apache的一个开源项目,用来实现不同语言之间的通信,要使用编程语言操作cassandra,就需要Thrift。
可惜的是Ubuntu还不能使用apt-get安装Thrift,因此需要手工编译
编译环境:Ubuntu 8.10 (8.04的libtool包不能用)
首先安装必要的包
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
然后下载Thrift的源码包,并编译安装
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
cd thrift-0.2.0
./configure
make
sudo make install
安装成功,

使用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

相关文章:

  • 2022-12-23
  • 2021-04-09
  • 2021-12-04
  • 2021-09-11
  • 2021-10-16
  • 2022-12-23
猜你喜欢
  • 2021-09-05
  • 2021-12-14
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
相关资源
相似解决方案