Scribe快速安装方法

      上一篇了解了scribe的源码安装法,在安装过程中boost库和后面的scribe在安装时出现多次的库依赖问题,为了更快速的部署scribe,打算boost采用apt安装(只要版本大于1.33即可)。

1 提前安装好相关依赖包

apt-get install build-essential bison flex libboost-all-dev
apt-get install libevent-dev libglib2.0-dev  libboost-dev libssl-dev python-dev 
apt-get install libboost-system-dev libboost-filesystem-dev libtool 
apt-get install git automake

2 安装thrift

wget  https://dist.apache.org/repos/dist/release/thrift/0.9.0/thrift-0.9.0.tar.gz
tar zxvf thrift-0.9.0.tar.gz
cd thrift-0.9.0/
./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H"
make
make install

cd contrib/fb303/
./bootstrap.sh
make 
make install

3 安装scribe

git clone https://github.com/facebook/scribe
cd scribe/
cd src/
g++  -Wall -O3 -L/usr/lib  -o scribed store.o store_queue.o conf.o file.o conn_pool.o scribe_server.o network_dynamic_config.o dynamic_bucket_updater.o  env_default.o  -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -lfb303 -lthrift -lthriftnb -levent -lpthread  libscribe.a libdynamicbucketupdater.a -lboost_system-mt -lboost_filesystem-mt

cd ..
./bootstrap.sh
./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DBOOST_FILESYSTEM_VERSION=2"
make
make install

错误解决

安装scribe在make的时候出现如下错误:

undefined reference to `boost::system::generic_category()'
undefined reference to `boost::system::generic_category()'
undefined reference to `boost::system::system_category()'
解决办法1:
进入scribe源码包的scr目录执行如下:
g++  -Wall -O3 -L/usr/lib  -o scribed store.o store_queue.o conf.o file.o conn_pool.o scribe_server.o network_dynamic_config.o dynamic_bucket_updater.o  env_default.o  -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -lfb303 -lthrift -lthriftnb -levent -lpthread  libscribe.a libdynamicbucketupdater.a -lboost_system-mt -lboost_filesystem-mt
解决办法2:
在configure的时候加上-lboost_system-mt -lboost_filesystem-mt参数

-DBOOST_FILESYSTEM_VERSION=2 参数只有在你的boost版本大于1.46的时候需要添加

测试时错误:

root@py-6:~/scribe/examples# echo  "hello world"|./scribe_cat test
Traceback (most recent call last):
  File "./scribe_cat", line 24, in <module>
    from scribe import scribe
ImportError: No module named scribe

解决办法
在debian/ubuntu系列安装完毕后,python的scribe模块并没有在默认搜索路径中,所以:
cp -a /usr/lib/python2.7/site-packages/* /usr/lib/python2.7/dist-packages/
库连接错误:

root@vm-6:~/scribe# scribed -c examples/example1.conf 
scribed: error while loading shared libraries: libthrift-0.9.0.so: cannot open shared object file: No such file or directory

ldd /usr/local/bin/scribed 发现
	libthrift-0.9.0.so => not found
	libthriftnb-0.9.0.so => not found
在/usr/local/lib/中都已经有该so文件,因为是环境变量有问题

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

更进一步的做法是把scribe做成deb包

参考连接:

http://www.nosql.se/2012/10/tutorial-installing-scribe-on-debianubuntu/

https://groups.google.com/forum/#!msg/scribe-server/cPGx9JkyWE8/SbGzl7Fd1P8J


转载于:https://my.oschina.net/guol/blog/110236

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值