scribe安装记录( + 修订版)

环境和准备

  1. CentOS 6.2 64bit
  2. scribe (版本 63e4824,发布时间 Jan 06, 2012。最新2.2版本编译不通过,朋友说要改源码,放弃)
  3. thrift 0.7
  4. 安装前请先把rpmforge和EPEL的yum仓库配置好,参见-> 这里
  5. 查看本机安装rpm包命令:yum list installed | grep <pkg-name>

开始安装

  • gcc (安装版本为4.4.6 官方要求>=3.3.5,但低于4会有各种问题
    g++ 如果g++的结果是no input files表示已安装,不是则安装)
yum -y install gcc+ gcc-c++
  •  flex、pkgconfig、m4
yum -y install flex pkgconfig m4
  •  python 安装版本为2.6.6
yum -y install python.x86_64
yum -y install python-devel.x86_64
  •  ruby 安装版本为1.8.7
yum -y install ruby.x86_64
yum -y install ruby-devel.x86_64
  • libevent  安装版本为1.4.13-4(系统自带的1.4.13-1不行!)
yum -y install libevent.x86_64
yum -y install libevent-devel.x86_64
  • openssl-devel  安装版本为1.0.0
yum -y install openssl.x86_64
yum -y install openssl-devel.x86_64
  • bz2-devel 安装版本为1.0.5
yum -y install bzip2.x86_64
yum -y install bzip2-devel.x86_64
  • zlib-devel  安装版本为1.2.3
yum -y install zlib.x86_64
yum -y install zlib-devel.x86_64
  •  bison  安装版本为2.4.1
yum -y install bison.x86_64
yum -y install bison-devel.x86_64
  •  autoconf 安装版本为2.69   thrift要求>=2.65
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz (CentOS6.3yum版本不够高)
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
wget http://ftp.gnu.org/gnu/automake/automake-1.10.tar.gz
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
wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.4.tar.gz
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
#卸载系统自带boost 1.41 检查与卸载命令:
yum list installed | grep boost
yum remove boost*

 

wget http://nchc.dl.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.gz
tar zxvf boost_1_45_0.tar.gz -C /usr/local/
cd /usr/local/boost_1_45_0
./bootstrap.sh
./bjam install

 

> vi /etc/profile
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要求修改代码才能编译过,放弃! )
wget http://archive.apache.org/dist/thrift/0.7.0/thrift-0.7.0.tar.gz
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
wget https://codeload.github.com/facebook/scribe/legacy.tar.gz/63e4824838bf84e35da6a0817d8a72a6ec0b9fb3
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

 

cd /usr/local/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能正常工作

 

写道
cd /usr/local/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

 

 

你可能感兴趣的:(安装)