下载scribe
解压
unzip master.zip
cd scribe-master
运行命令:
./bootstrap.sh --prefix=/usr/local/include/scribe --with-thriftpath=/usr/local/include/thrift/ --with-fb303path=/usr/local/include/thrift/fb303/ --with-boost=/usr/local/include/boost/
automake-1.14: error: global options already processed
vim configure.ac
# AM_INIT_AUTOMAKE (此行注释掉)
报错:
configure: error: Could not link against ! (下面的configure会解决)
./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H"
make
make install
启动scribe时所报错误:
src/scribed: error while loading shared libraries: libboost_system.so.1.53.0: cannot open shared object file: No such file or directory
这个是不能正确加载boost所导致,我们需要去检查下/usr/lib或/usr/lib64/目录下有没有libboost_system.so.1.53.0这个文件.如果你的操作系统是64位,可以根据命令getconf LONG_BIT查看,那就需要将libboost_system.so.1.53.0放到/usr/lib6/目录下即可.至于libboost_system.so.1.53.0文件在哪里?可以通过命令
sudo find / -name libboost_system.so.1.53.0
查找下即可,找到后再通过软连接过去.
引起这个原因大部分还是操作系统是64位,而boost经默认安装libboost_system.so.1.53.0被放到/usr/local/lib/目录下,所以我们需要软连接过去即可,
命令:
sudo ln -s /usr/local/lib/libboost_system.so.1.53.0 /usr/lib64/libboost_system.so.1.53.0
libboost_filesystem.so.1.53.0
libthrift-0.9.0.so
libthriftnb-0.9.0.so
参考:
解决configure: error: Could not link against !
问题描述:在./configure时出现error: Could not link against !
解决方法:来自 http://stackoverflow.com/questions/9132335/configure-error-could-not-link-against-boost-system
对于64位机:./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu
对于32位机:./configure --with-boost-libdir=/usr/lib/i386-linux-gnu(测试可用)
另一说法:来自https://baoz.net/%E8%A7%A3%E5%86%B3configure-error-could-not-link-against-%E9%97%AE%E9%A2%98boost%E7%9B%B8%E5%85%B3/
在64位里编译boost相关程序的时候,会遇到configure: error: Could not link against !错误。
解决方法是用–with-boost-libdir=/usr/lib64 指定库文件位置即可解决。
找不到scribe模块
[root@gls68 test]# cd /usr/lib
[root@gls68 lib]# find /usr/lib/ . -name "scribe*"
/usr/lib/python2.6/site-packages/scribe-2.0-py2.6.egg-info
/usr/lib/python2.6/site-packages/scribe
/usr/lib/python2.6/site-packages/scribe/scribe.pyc
/usr/lib/python2.6/site-packages/scribe/scribe.py
./python2.6/site-packages/scribe-2.0-py2.6.egg-info
./python2.6/site-packages/scribe
./python2.6/site-packages/scribe/scribe.pyc
./python2.6/site-packages/scribe/scribe.py
[root@gls68 test]# python
>>> sys.path.append('/usr/lib/python2.6/site-packages/')
>>> import scribe
>>>
不会报错了
NameError: global name 'TSocket' is not defined
sys.path.append('/usr/lib64/python2.6/site-packages/policycoreutils')
scribe开始的时候创建文件夹的日志
[Thu Nov 2 10:07:27 2017] "[90009_2017-11-02] Creating new category store from model default"
[Thu Nov 2 10:07:27 2017] "store thread starting"
[Thu Nov 2 10:07:27 2017] "[90009_gat_2017-11-02] Creating new category store from model default"
[Thu Nov 2 10:07:27 2017] "store thread starting"
[Thu Nov 2 10:07:27 2017] "Opened connection to remote scribe server <10.171.71.126:8250>"
[Thu Nov 2 10:07:27 2017] "[90009_2017-11-02] Opened file </root/scribe/log_bak/90009_2017-11-02/90009_2017-11-02_00000> for writing"
[Thu Nov 2 10:07:27 2017] "[90009_2017-11-02] Changing state from <DISCONNECTED> to <SENDING_BUFFER>"
[Thu Nov 2 10:07:27 2017] "[90009_2017-11-02] read <0> entries of <0> bytes from file </root/scribe/log_bak/90009_2017-11-02/90009_2017-11-02_00000>"
[Thu Nov 2 10:07:27 2017] "[90009_2017-11-02] No more buffer files to send, switching to streaming mode"
[Thu Nov 2 10:07:27 2017] "[90009_2017-11-02] Changing state from <SENDING_BUFFER> to <STREAMING>"
[Thu Nov 2 10:07:27 2017] "Opened connection to remote scribe server <10.171.71.126:8250>"
[Thu Nov 2 10:07:27 2017] "[90009_gat_2017-11-02] Opened file </root/scribe/log_bak/90009_gat_2017-11-02/90009_gat_2017-11-02_00000> for writing"
[Thu Nov 2 10:07:27 2017] "[90009_gat_2017-11-02] Changing state from <DISCONNECTED> to <SENDING_BUFFER>"
[Thu Nov 2 10:07:27 2017] "[90009_gat_2017-11-02] read <0> entries of <0> bytes from file </root/scribe/log_bak/90009_gat_2017-11-02/90009_gat_2017-11-02_00000>"
[Thu Nov 2 10:07:27 2017] "[90009_gat_2017-11-02] No more buffer files to send, switching to streaming mode"
[Thu Nov 2 10:07:27 2017] "[90009_gat_2017-11-02] Changing state from <SENDING_BUFFER> to <STREAMING>"
问题
Thrift: Wed Nov 1 19:03:30 2017 TNonblockingServer: client died: No more data to read.
应该是日志中出现了中文,由于中文部分不支持,故所有中文去掉
/root/scribe-master/src/gen-php/BucketStoreMapping.php
/root/scribe-master/src/gen-php/scribe.php
/root/thrift-0.9.0/lib/php/lib/Thrift/Transport/TSocketPool.php
/root/thrift-0.9.0/lib/php/lib/Thrift/Transport/TFramedTransport.php
/root/thrift-0.9.0/lib/php/lib/Thrift/Protocol/TBinaryProtocol.php
include_path='.:/usr/share/pear:/usr/share/php'
解决
require_once 改成 include_once
后台运行scribe
#!/bin/sh
export LANG=de_DE.UTF-8
start() {
nohup /usr/local/bin/scribed scribe.conf 1>/root/scribe/scribe.log 2>&1 &
}
start