【问题标题】:Piping Apache server log using Apache Flume使用 Apache Flume 管道 Apache 服务器日志
【发布时间】:2013-01-05 06:25:19
【问题描述】:

我使用的是 Apache Flume 1.3 版并参考Apache Flume User guide。

我的目标是pipe Apache server logs直接进入 Apache Flume Agent 的频道。如果我的理解是正确的,Apache 服务器将不会创建本地文件,即。 server.log、error.log 而是直接将对应的输出写入agent的channel;即使它写入日志,代理也不会从这些文件中读取。但至少 Apache 服务器的文档没有提供相同的示例。

我的查询是:

  1. 我提到了 this 链接,该链接与 Cloudera Flume 而不是 Apache Flume 相关。我试过了,但正如预期的那样,Apache 服务器出错了:

    /bin/sh: flume: not found
    piped log program 'flume node_nowatch -1 -s -n apache -c \\'apache:console|agentBESink("collector");\\'' failed unexpectedly
    piped log program 'flume node_nowatch -1 -s -n apache -c \\'apache:console|agentDFOSink("collector");\\'' failed unexpectedly
    

我怀疑 Apache Flume 和 Cloudera Flume 是否同步。

  1. 根据 Apache 服务器的文档: Apache httpd 能够写入错误并通过管道将日志文件访问到另一个进程,而不是直接访问文件。 如何为正在运行的 Apache Flume 代理实现这一点,即 Apache conf 中的条目必须是什么

自定义日志 "| ?"常见的

【问题讨论】:

    标签: apache apache2 flume


    【解决方案1】:

    我正在尝试类似的用例。您的问题是水槽命令不存在(不再存在)。较新版本的水槽使用命令 flume-ng。

    我在 /etc/httpd/conf/httpd.conf 中做了什么:

    # Default behaviour, but daily-rollover logging (|| does not spawn a new shell) 
    CustomLog "||/usr/sbin/rotatelogs /var/log/httpd/access_log.%Y-%m-%d 86400" combined
    # Send logging to local flume-agent
    CustomLog "||/usr/bin/flume-ng avro-client -H localhost -p 10000" combined
    

    flume-agent 配置在 localhost 上有一个 avro 源绑定并侦听端口 10000。还有一个文件通道,在我们的例子中是一个 HDFS-sink。

    请注意,当 Flume-agent 崩溃或您重新启动 Flume 时,您将丢失一些日志记录事件。如果您想要一个更持久的解决方案,您需要拾取(旧的/循环的)日志文件并在处理时移动/删除。

    【讨论】:

      猜你喜欢
      • 2014-02-26
      • 1970-01-01
      • 1970-01-01
      • 2012-12-06
      • 2016-01-07
      • 1970-01-01
      • 2016-02-17
      • 1970-01-01
      • 2017-04-18
      相关资源
      最近更新 更多