Christopher David Petersen wrote:
On 5/5/05, *Kevin Kuphal* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
Is there any easy way for code running on a frontend to get the proper hostname of the master backend for use when saving information to the DB where you have to set the hostname to the backend name, not the frontend name?
Thanks, Kevin _______________________________________________ mythtv-dev mailing list [email protected] <mailto:[email protected]> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
This problem presents itself in almost every distributed system. The solution I've always employed is to have the "master" backend, database server, load distributor, etc. broadcast a "beacon" via UDP to a particular IP subnet. As various "slave" machines (horrible nomenclature, but not mine. No flames please.) are attached to the subnet they listen for the beacon and determine the address of its sender.
I'm not sure whether MythTV employs such a beacon (perhaps MythTV has employed a better solution that I'm unaware of), but implementing such feature is relatively simple. When I get a MythTV development machine, I may even try implementing it.
I can probably just write the backend startup to record it's hostname in a new setting value in the DB if it is the master.
Kevin _______________________________________________ mythtv-dev mailing list [email protected] http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
