[collectd] Fwd: [5.1] Multiple mysql instances?

Sebastian Harl sh at tokkee.org
Mon Mar 18 21:29:19 CET 2013


Hi,

On Mon, Mar 18, 2013 at 11:12:24AM +0100, Fabien Wernli wrote:
> On Mon, Mar 18, 2013 at 09:37:22AM +0100, Jacek Osiecki wrote:
> > LoadPlugin mysql
> > <Plugin mysql>
> > 	<Database "sqlone">
> > 		User "backup"
> > 		Password "xxxx"
> > 		Host "192.168.0.21"
> > 		Database "mysql"
> > 		#Socket "/var/lib/mysql/sc-sqlcrit/mysql.sock"
> > 	</Database>
> > 	<Database "sqltwo">
> > 		User "backup2"
> > 		Password "yyyy"
> > 		Database "mysql"
> > 		Host "192.168.0.22"
> > 		#Socket "/var/lib/mysql/sc-sqlmain/mysql.sock"
> > 	</Database>
> > </Plugin>
> > 
> > I tried many combinations: using "Host" in first database and "Socket" in second one, using
> > different users - nothing helped. Always only the first database is handled.
> > 
> > Am I doing something wrong, or is collectd simply unable to handle two (or more) mysql servers?
> 
> I think the 'Database' directive *in* the block overrides the name in the 'Database'
> *definition*. This means that in your example, `sqlone` and `sqltwo` are
> both being overridden by `mysql`, thus yielding the error message. I
> remember banging my head on a hard surface too when trying to achieve the
> same goal.

This issue should have been fixed in 5.1.1. The name of the <Database>
definition is now used when registering the callback. The above
configuration is perfectly fine in that case.

> If I were you, I'd simply drop the `Database "mysql"` from your
> example, and it should work as-is.

No, this will only make the plugin not connect to any specific database.
Before 5.1.1, you'd have to specify *different* database names (using
the "Database" option within the "<Database>" block) in order to make
this work.

HTH,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20130318/c1e05ab8/attachment.pgp>


More information about the collectd mailing list