fluent+mongodb搭建日志系统中的几个问题

本文档记录了使用Fluentd搭建日志系统时遇到的问题,包括安装fluent-plugin-mongo插件时的错误提示,C extension未加载的警告,配置文件fluent.conf的示例,以及成功运行后的日志输出。通过解决这些问题,成功将日志存储到MongoDB中。
摘要由CSDN通过智能技术生成

1.运行时如下错误,

error="Unknown output plugin 'mongo'. Run 'gem search -rd fluent-plugin' to find plugins"
搜索mongodb插件
gem search -rd fluent-plugin-mongo 
得到结果
*** REMOTE GEMS ***


fluent-plugin-mongo (0.6.7)
    Author: Masahiro Nakagawa
    Homepage: https://github.com/fluent/fluent-plugin-mongo


    MongoDB plugin for Fluent event collector
安装这个插件
gem install fluent-plugin-mongo


2、运行的时候可能会得到如下提示
**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance.
  You can install the extension as follows:
  gem install bson_ext


  If you continue to receive this message after installing, make sure that the
  bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version.
按照上述提示执行 gem install bson_ext

3、flunt.conf

<source>

 type tail 
 path /home/aircom/mongodb-linux-i686-2.0.6/bin/logs/1001.log
format /^*(?<message>.*)$/
#format /^(?<time>[^ ]* [^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?[^\:]*\: *(?<message>.*)$/
#time_format %b %d %H:%M:%S
 tag mongo.apache
</source>
<match mongo.**>
 type mongo
 database apache
 collection fmongo
 host Server202
 port 10001
 flush_interval 10s
</match>

4、login primary node run command

 PRIMA

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值