List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:June 12 2007 5:32pm
Subject:Re: MySql Host through Heartbeat
View as plain text  
Hi,

Ben Clewett wrote:
> Dear MySQL,
> 
> I'm running 5.0.26 through Heartbeat.  Which seems to work well, even as 
> a replication slave and Heartbeat continously stopping and starting the 
> server.
> 
> The Heartbeat moves MySQL around from server to server when a failure 
> occures.  I am trying to find a way for MySQL to report the server host 
> name on which it's currently sitting.  Without any luck.
> 
> Would any kind members know of a way of getting this information from 
> MySQL?

I only know of two ways, though there may be more.

1) The hostname system variable, which was added in 5.0.41 
(http://dev.mysql.com/doc/refman/5.0/en/releasenotes-cs-5-0-41.html)

2) Perhaps a UDF that makes a system call.

There might be some external ways to do it also.  For example, create a table with a 
single row, and have a startup script replace the value in it with the server's 
hostname upon startup.  Then you can query this value.

Cheers
Baron
Thread
MySql Host through HeartbeatBen Clewett12 Jun
  • Re: MySql Host through HeartbeatBaron Schwartz12 Jun
    • Re: MySql Host through HeartbeatBen Clewett12 Jun
  • Re: MySql Host through HeartbeatGerald L. Clark12 Jun
    • Re: MySql Host through HeartbeatBaron Schwartz12 Jun
      • Re: MySql Host through HeartbeatGerald L. Clark12 Jun
        • Re: MySql Host through HeartbeatBaron Schwartz12 Jun
          • Re: MySql Host through HeartbeatBen Clewett13 Jun
            • Re: MySql Host through HeartbeatScott Tanner13 Jun
              • Re: MySql Host through HeartbeatAtle Veka14 Jun