为什么做的网站在浏览器搜不到,微营销教程,广州网络推广培训机构,营销型网站制作平台源代码里所给的example很简单#xff0c;但大体上了模拟了其运行的过程#xff0c;分三个部分。可参考里面的README文件#xff1a;Configurarion#xff08;配置#xff09;、Running Scribe Server#xff08;运行服务器#xff09;、Logging messages#xff08;记录…源代码里所给的example很简单但大体上了模拟了其运行的过程分三个部分。可参考里面的README文件Configurarion配置、Running Scribe Server运行服务器、Logging messages记录日志 先运行Scribe example来看看效果。 1.Example1向已经启动的Server发送消息验证是否被记录下来。 #创建日志信息存放目录 $mkdir /tmp/scribetest #用example1.conf配置文件启动Scribe服务: $scribed examples/example1.conf #开启另一个终端使用scribe_cat 向scribe服务发送信息: $echo hello world | ./scribe_cat test 这时你很可能会出现如下错误提示 也就是说python导入模块scribe失败但我们打开/usr/lib/python2.6/site-packages发现里面是有scribe的模块的所以很可能是PYTHONPATH没有配置正确。使用如下命令进行配置 进入到/etc目录然后输入命令gedit profileprofile文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行在此文件中添加如下内容 $export PYTHONPATH ”/usr/lib/python2.6/site-packages”$source /etc/profile 或 找到系统安装Python的路径如我的是/usr/local/python2.6将/usr/lib/python2.6/site-packages下内容拷贝到/usr/local/lib/python2.6/site-packages下即可。 #Verify that the message got logged: $cat /tmp/scribetest/test/test_current#检查scribe状态(requires root):$./scribe_ctrl status#检查scribe连接数 (you should see 1 message received good):$./scribe_ctrl counters#关闭scribe服务:$./scribe_ctrl stop 2) Example2启动中心服务器和客户端服务器然后开启一个终端并输入三条命令并查看结果 示意图如下 执行如下命令 #启动中央服务器$scribed example2central.conf #启动客户端服务器$scribed example2client.conf $mkdir /tmp/scribetest2$scribed examples/example2central.conf$scribed examples/example2client.conf$echo test message | ./scribe_cat -h localhost:1464 test2$echo this message will be ignored | ./scribe_cat -h localhost:1464 ignore_me$echo 123:this message will be bucketed | ./scribe_cat -h localhost:1464 bucket_me 查看结果 $cat /tmp/scribetest/test2/test2_current$cat /tmp/scribetest/bucket*/bucket_me_current./scribe_ctrl status 1463./scribe_ctrl status 1464./scribe_ctrl counters 1463 #查看中心服务器的统计数据./scribe_ctrl counters 1464 #查看客户端服务器的统计数据 当客户端服务器讲收到的信息发送给中心服务器后会删除本地的存储。 结果显示客户端收到三条消息发送了三条消息服务器端收到三条消息忽略了一条消息。 3) Example3如同Example2启动中心服务器和客户端服务器但本例测试的是在中心服务器突然down掉的情况下客户端服务器的缓冲存储功能。 $echo test message 1 | ./scribe_cat -h localhost:1464 test3 #发送消息1$cat /tmp/scribetest/test3/test3_current #结果test message 1$./scribe_ctrl stop 1463 #down掉中心服务器$./scribe_ctrl status 1463 #结果Failed to get status$echo test message 2 | ./scribe_cat -h localhost:1464 test3 #发送消息2$./scribe_ctrl status 1464 #结果WARNING - Failed to connect$echo test message 3 | ./scribe_cat -h localhost:1464 test3 #发送消息3$scribed examples/example2central.conf #重新启动中心服务器$./scribe_ctrl status 1463 #结果ALIVE$./scribe_ctrl status 1464 #结果ALIVE$cat /tmp/scribetest/test3/test3_current #结果 test message 1test message 2test message 3 全部正常接收转载于:https://www.cnblogs.com/oubo/archive/2011/10/28/2394610.html