wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar zxvf autoconf-2.69.tar.gz -C /usr/local/
cd /usr/local/autoconf-2.69/
./configure --prefix=/usr
make
make install
14.autoconf
安装版本为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
15.libtool
安装版本为2.24
wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.4.tar.gz
tar zxvf automake-1.10.tar.gz -C /usr/local/
cd /usr/local/automake-1.10
./configure --prefix=/usr
make
make install
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
开始安装fb303 cd contrib/fb303
chmod +x bootstrap.sh
./bootstrap.sh
./configure
make
make install
tar zxvf facebook-scribe-63e4824.tar.gz -C /usr/local/
cd facebook-scribe-63e4824
./bootstrap.sh
./configure --prefix=/usr/local/scribe
make
make install
检验安装是否成功(纯转):
1、配置scribe
首先我的scribe装在/usr/local/scribe中,在该目录/usr/local/scribe下,
mkdir conf
然后将facebook-scribe下的examples/example1.conf拷到conf中
2、启动scribe
cd /usr/local/scribe
bin/scribed -c conf/example1.conf
出现如下提示,启动成功:
[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
3、验证scribe能正常工作
examples文件夹下有Readme,按照这个操作就行,简单来说
先启动scribe:
scribe安装路径/bin/scribed -c scribe解压路径/examples/example1.conf
出现提示信息:
[Wed Dec 21 17:12:01 2011] "STATUS: STARTING"
[Wed Dec 21 17:12:01 2011] "STATUS: configuring"
[Wed Dec 21 17:12:01 2011] "got configuration data from file <conf/example1.conf>"
[Wed Dec 21 17:12:01 2011] "CATEGORY : default"
[Wed Dec 21 17:12:01 2011] "Creating default store"
[Wed Dec 21 17:12:01 2011] "configured <1> stores"
[Wed Dec 21 17:12:01 2011] "STATUS: "
[Wed Dec 21 17:12:01 2011] "STATUS: ALIVE"
[Wed Dec 21 17:12:01 2011] "Starting scribe server on port 1463"
然后在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
表示安装成功。
然后再testapp中新建一个test.rb文件,内容是
#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/scribe')
require 'scribe'
begin
socket = Thrift::Socket.new('localhost', 1463)
transport = Thrift::FramedTransport.new(socket)
protocol = Thrift::BinaryProtocol.new(transport, false)
client = Scribe::Client.new(protocol)
transport.open()
log_entry = LogEntry.new(:category => 'test', :message => 'This is a test message')
client.Log([log_entry])
transport.close()
rescue Thrift::Exception => tx
print 'Thrift::Exception: ', tx.message, "\n"
end
修改test.rb的执行权限,chmod +x test.rb
执行test.rb,./test.rb
scribe出现提示信息:
[Wed Nov 9 10:35:58 2011] "[test] Creating new category store from model default"
[Wed Nov 9 10:35:58 2011] "store thread starting"
[Wed Nov 9 10:35:58 2011] "[test] Opened file </tmp/scribetest/test/test_00000> for writing"
[Wed Nov 9 10:35:58 2011] "[test] Opened file </tmp/test/test_00000> for writing"
[Wed Nov 9 10:35:58 2011] "[test] Changing state from <DISCONNECTED> to <SENDING_BUFFER>"
[Wed Nov 9 10:35:58 2011] "[test] read <0> entries of <0> bytes from file </tmp/test/test_00000>"
[Wed Nov 9 10:35:58 2011] "[test] No more buffer files to send, switching to streaming mode"
[Wed Nov 9 10:35:58 2011] "[test] Changing state from <SENDING_BUFFER> to <STREAMING>"
查看/tmp/scribetest/test/test_00000,它的内容是:
This is a test message
表示scribe工作正常啦~~