No commit activity in last 3 years
No release in over 3 years
Fluentd plugin for Apache Zookeeper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 12.0
~> 3.0

Runtime

< 2, >= 0.14.10
~> 3.0
~> 1.0
 Project Readme

fluent-plugin-zookeeper

Fluentd output plugin for Apache Zookeeper.

Installation

RubyGems

$ gem install fluent-plugin-zookeeper

Bundler

Add following line to your Gemfile:

gem "fluent-plugin-zookeeper"

And then execute:

$ bundle

Configuration

The following is an example plugin configuration for Fluentd health monitoring:

<source>
  @type exec
  command echo -n '{"message": "heartbeat"}'
  tag heartbeat
  format json
  run_interval 10s
</source>

<match heartbeat.**>
  @type copy
  <store>
    @type zookeeper
    servers <zookeeper_server1>:<zookeeper_port1>,<zookeeper_server2>:<zookeeper_port2>,<zookeeper_server3>:<zookeeper_port3>,...
    path "/fluent/#{Socket.gethostname}_persistent"
  </store>
  <store>
    @type zookeeper
    servers <zookeeper_server1>:<zookeeper_port1>,<zookeeper_server2>:<zookeeper_port2>,<zookeeper_server3>:<zookeeper_port3>,...
    path "/fluent/#{Socket.gethostname}_ephemeral"
    type ephemeral
  </store>
</match>

Configuration above uses in_exec plugin as a heartbeat message generator. During normal operation two znodes will exist on Zookeeper for a host running Fluentd: persistent and ephemeral. Ephemeral znode is deleted automatically if fluentd has a "bad health" or network/connection problem. So, having only one persistent znode is a signal to trigger alert.

TODO

Let me know if support for buffered output mode and older versions of fluentd is necessary.