fluent/fluent-plugin-mongo — Issue #9: mongo_replset unexpectedly requires 'host' in configuration
Author: k24d
Created: 2012-02-23 07:10:51+00:00
State: open

According to README.rdoc, the configuration of "mongo_replset" is defined as follows:

<match mongo.**>
type mongo_replset
database fluent
collection logs

# each node separated by ','
nodes localhost:27017,localhost:27018,localhost:27019
...

In reality, it doesn't work as I expect. Given the configuration like this:

<match mongo.**>
type mongo_replset
database fluent
collection logs
nodes mg1:27017,mg2:27017,mg3:27017
...

I got the following message:

# fluentd -v
2012-02-23 15:35:55 +0900: fluent/supervisor.rb:143:supervise: starting fluentd-0.10.13
...
2012-02-23 15:35:55 +0900: fluent/engine.rb:79:block in configure: adding match pattern="**" type="mongo_replset"
2012-02-23 15:35:55 +0900: plugin/out_mongo.rb:186:rescue in available_buffer_chunk_limit: Failed to connect to 'mongod'. Please restart 'fluentd' after 'mongod' started: Failed to connect to a master node at localhost:27017

I needed to add "host" in addtion to "nodes":

<match mongo.**>
type mongo_replset
database fluent
collection logs
host mg1 # THIS LINE REQUIRED!
nodes mg1:27017,mg2:27017,mg3:27017
...

I suppose mongo_replset should refer to "nodes" instead of "host".

Cheers,