Hi, Thank you very much; your suggested changes to mongodb_uri worked perfectly, and our several-node Graylog cluster is now working as expected.
On Monday, February 22, 2016 at 5:33:52 PM UTC, Florent B wrote: > > Hi, > > You can set multiple MongoDB servers in mongodb_uri as specified in > example config file : > > mongodb_uri = > mongodb://grayloguser:secret@localhost:27017,localhost:27018,localhost:27019/graylog2 > > On 02/22/2016 03:39 PM, [email protected] <javascript:> wrote: > > > Hello, > > We're currently implementing a setup with three-graylog servers, and we're > having a lot of problems getting MongoDb to work correctly with Graylog: > > - In order to run a cluster of three Graylog (1.2.1) servers, you need > to set up a MongoDB replica set. > - 'mongodb_uri' (set in the configuration file) needs to point to the > MongoDB replica set *primary*; (in this case we try to set it to > "vm-0"). > - Graylog fails with the following error if the URI does not point to > the replica set primary (at least on initial startup): > > > ERROR [CmdLineTool] Guice error (more detail on log level debug): Error > injecting constructor, com.mongodb.CommandFailureException: { "serverUsed" > : "vm-0:27017" , "ok" : 0.0 , "errmsg" : "not master" , "code" : 10107} > > > > - There is no way to specify three mongodb_uri values, and let Graylog > 'detect' which of these is primary. > - It is difficult to force MongoDB to set a particular VM to be > primary reliably. > > This means that it is difficult to guarantee that mongodb_uri is pointing > to the current MongoDB master. There's only two ways I know how to ensure > Graylog' mongo_uri is pointing to the current master: > > - Dynamically change the Graylog configuration file to point to the > current primary each time Graylog starts up. > - Write scripts to try force MongoDB's to place its primary on a > particular server. > > Neither of these are very good solutions, and manual setup is not an > option (the deployment is fully automated). > > Is there an easier way of configuring Graylog to always point towards the > current MongoDB replica set primary? Unfortunately, my options don't > include upgrading to 2.0. > > Thanks for any help you can offer; if any clarification is needed please > leave an email and I'll respond quickly. > > > *Server Layout:* > > VM-0: > > - Graylog-Server > - ElasticSearch > - MongoDb > > > VM-1: > > - Graylog-Server > - Graylog-Web > - ElasticSearch > - MongoDb > > > > VM-2: > > - Graylog-Server > - ElasticSearch > - MongoDb > > > *Versions:* > > > - Web 1.3.3 > - Server 1.2.2 > > > > *Graylog's MongoDb-Related Configuration:* > > mongodb_useauth = false > mongodb_uri = mongodb: > //vm-0:27017/graylog2 > mongodb_max_connections = 100 > mongodb_threads_allowed_to_block_multiplier = 5 > mongodb_replica_set = vm-0:27017,vm-1: > 27017,vm-2:27017 > > > *MongoDB Configuration:* > > storage: > dbPath: /var/lib/mongodb > journal: > enabled: true > > > systemLog: > destination: file > logAppend: true > path: /var/log/mongodb/mongod.log > > > net: > port: 27017 > > > replication: > replSetName: vm-replicaset-0 > > > > > > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Graylog Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To view this discussion on the web visit > <https://groups.google.com/d/msgid/graylog2/eb939a2b-939b-4f77-8ad0-e39e9ddfcad3%40googlegroups.com?utm_medium=email&utm_source=footer> > https://groups.google.com/d/msgid/graylog2/eb939a2b-939b-4f77-8ad0-e39e9ddfcad3%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Graylog Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/graylog2/806a7a18-54b3-441e-85c6-696b2b26cc3b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
