环境和准备
- CentOS 6.2 64bit
- scribe (版本 63e4824,发布时间 Jan 06, 2012。最新2.2版本编译不通过,朋友说要改源码,放弃)
- thrift 0.7
- 安装前请先把rpmforge和EPEL的yum仓库配置好,参见-> 这里
- 查看本机安装rpm包命令:yum list installed | grep <pkg-name>
开始安装
- gcc (安装版本为4.4.6 官方要求>=3.3.5,但低于4会有各种问题
g++ 如果g++的结果是no input files表示已安装,不是则安装)
- flex、pkgconfig、m4
- python 安装版本为2.6.6
yum -y install python-devel.x86_64
- ruby 安装版本为1.8.7
yum -y install ruby-devel.x86_64
- libevent 安装版本为1.4.13-4(系统自带的1.4.13-1不行!)
yum -y install libevent-devel.x86_64
- openssl-devel 安装版本为1.0.0
yum -y install openssl-devel.x86_64
- bz2-devel 安装版本为1.0.5
yum -y install bzip2-devel.x86_64
- zlib-devel 安装版本为1.2.3
yum -y install zlib-devel.x86_64
- bison 安装版本为2.4.1
yum -y install bison-devel.x86_64
- autoconf 安装版本为2.69 thrift要求>=2.65
tar zxvf autoconf-2.69.tar.gz -C /usr/local/
cd /usr/local/autoconf-2.69/
./configure --prefix=/usr
make
make install
- automake 安装版本为1.10 thrift安装警告,要求>=1.9
tar zxvf automake-1.10.tar.gz -C /usr/local/
cd /usr/local/automake-1.10
./configure --prefix=/usr
make
make install
- libtool 安装版本为2.24
tar zxvf libtool-2.2.4.tar.gz -C /usr/local/
cd /usr/local/libtool-2.2.4
./configure --prefix=/usr
make
make install
- boost 安装版本为1.45.0 官方版本要求>=1.36
yum list installed | grep boost
yum remove boost*
tar zxvf boost_1_45_0.tar.gz -C /usr/local/
cd /usr/local/boost_1_45_0
./bootstrap.sh
./bjam install
export BOOST_ROOT=/usr/local/boost_1_45_0
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
> source /etc/profile
- thrift + fb303 安装版本为0.7.0 官网要求>=0.5.0 (0.8要求修改代码才能编译过,放弃! )
tar zxvf thrift-0.7.0.tar.gz -C /usr/local/
cd /usr/local/thrift-0.7.0
chmod +x configure
./configure
make
make install
cd contrib/fb303 # 开始安装fb303
chmod +x bootstrap.sh
./bootstrap.sh
./configure
make
make install
- scribe
tar zxvf facebook-scribe-63e4824.tar.gz -C /usr/local/
cd /usr/local/facebook-scribe-63e4824
./bootstrap.sh
./configure --prefix=/usr/local/scribe
make
make install
检验安装是否成功
1. 启动scribe
bin/scribed -c conf/example1.conf
i出现如下提示,启动成功:
[Wed Nov 9 10:35:52 2011] "STATUS: STARTING"
[Wed Nov 9 10:35:52 2011] "STATUS: configuring"
[Wed Nov 9 10:35:52 2011] "got configuration data from file <conf/example1.conf>"
[Wed Nov 9 10:35:52 2011] "CATEGORY : default"
[Wed Nov 9 10:35:52 2011] "Creating default store"
[Wed Nov 9 10:35:52 2011] "configured <1> stores"
[Wed Nov 9 10:35:52 2011] "STATUS: "
[Wed Nov 9 10:35:52 2011] "STATUS: ALIVE"
[Wed Nov 9 10:35:52 2011] "Starting scribe server on port 1463"
Thrift: Wed Nov 9 10:35:52 2011 libevent 1.4.13-stable method epoll
2. 验证scribe能正常工作
mkdir conf
cp scribe解压目录/examples/example1.conf /usr/local/scribe/conf
bin/scribed -c conf/example1.conf
/usr/local/scribe/bin/scribed -c /usr/local/scribe/conf/example1.conf
# 在examples目录下,发个数据给scribe:
echo "hello world" | ./scribe_cat test
发现scribe出现如下信息:
[Wed Dec 21 17:14:30 2011] "[test] Creating new category store from model default"
[Wed Dec 21 17:14:30 2011] "store thread starting"
[Wed Dec 21 17:14:30 2011] "[test] Opened file </tmp/scribetest/test/test_00000> for writing"
[Wed Dec 21 17:14:30 2011] "[test] Opened file </tmp/test/test_00000> for writing"
[Wed Dec 21 17:14:30 2011] "[test] Changing state from <DISCONNECTED> to <SENDING_BUFFER>"
[Wed Dec 21 17:14:30 2011] "[test] read <0> entries of <0> bytes from file </tmp/test/test_00000>"
[Wed Dec 21 17:14:30 2011] "[test] No more buffer files to send, switching to streaming mode"
[Wed Dec 21 17:14:30 2011] "[test] Changing state from <SENDING_BUFFER> to <STREAMING>"
查看log cat /tmp/scribetest/test/test_00000 出现:
hello world表示安装成功。
原文转自:http://lakeblur.iteye.com/blog/1676022