List:General Discussion« Previous MessageNext Message »
From:Alec.Cawley Date:February 28 2005 5:56pm
Subject:Re: Automatic server-id generation for slaves?
View as plain text  
"Kevin A. Burton" <burton@stripped> wrote on 28/02/2005 17:41:07:

> Right now one of the only reasons we can't put our entire config for our 

> slaves in CVSup is that the config *requires* the ability to set a 
> server-id for each machine.
> Seems like it would be pretty trivial to support a hostname based policy 

> for this.   You could simply look at the IP/hostname and set the value 
> from this (though you might need a tracking table).
> Policies could include:
> - IP based server-id (IPs are 32bit)
> - parse the hostname for an ID ( would yield a server-id 
of 4)
> - Adler32/SHA1 truncate the hashcode of the hostname
> The first two seem sufficient.  This wouldn't be the default of course 
> and would require an explicit config.
> Thoughts?

Nice. At the moment, because I have a supervisory application, I have a 
table inside the database with hostname->serverid lookup. The machine 
starts up with the slave thread disabled, and the supervisory app reads 
the slave id from the database and sets it before enabling the slave 

This could be replicated inside MySQL, with a hostname to slave ID table 
in the mysql database. Obviously, explicitly assigned slave IDs would 
override this.


Automatic server-id generation for slaves?Kevin A. Burton28 Feb
  • Re: Automatic server-id generation for slaves?Alec.Cawley28 Feb