Multiserver setup bug

Discussion in 'Installation/Configuration' started by Murder4Al, Jun 6, 2009.

  1. Murder4Al

    Murder4Al New Member

    HI there,

    I was setup up multi-server setup where my mysql server was split of to a separate box.
    This tripped a bug in the slave-stuff since on that machine the $conf["dbmaster_host"] and $conf["db_host"] are identical.

    This clashes with lib/app.inc.php line 47 resulting in my local db being used as a master.
    The piece of code reads:
    if($conf["dbmaster_host"] != '' && $conf["dbmaster_host"] != $conf["db_host"]) { -- Config master -- } else { --User local as master--}

    Is there any reason for this double check to be here? I would assume that the fact that a master server is present should be enough to use it.

    So in my opinion, either the check needs to be removed or you need to change it to check the dabase names instead of the hosts.

    ** Edit
    Looks like a similar check is in place @ lib/classes/modules.inc.php line 86.
    I changed the line to:
    if($app->db->dbName != $app->dbmaster->dbName) {

    Now it's working like a charm ;-)

    **

    Greets
    Kobe
     
    Last edited: Jun 6, 2009
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    In a master / slave setup with a separate dtabase server, $conf["dbmaster_host"] and $conf["db_host"] can not be identical. If they are identical in your setup, its a problem how you setup your server and not with the code.

    Yes, it is. The slave will and shall not have permissions to write to the amster server db except of the log table.
     
  3. Murder4Al

    Murder4Al New Member

    Till,

    Care to elaborate on that? I don't see any error in my setup (it works fine).

    I have one dedicated mysql server that hosts the main ISPConfig database and the local slave database, so the ispconfig install on this machine (this is a slave machine) has the conf["dbmaster_host"] and $conf["db_host"] being 'localhost' since both databases are on the local machine.
    Note that I do NOT have mysql on my ISPConfig master server!

    The dbNames of both are evidently different, and I think you should put your check on those and not on the actual servername.

    One can easily fix this by changing one of both to a local alias af course, but that's not the cleanest solution.

    Greets
     
  4. Murder4Al

    Murder4Al New Member

    Till,

    I believe I now see what's the issue.
    If I'm not mistaking the multi-server setup assumes that each slave has a local MySQL server.

    If you drop this assumption then the master & local instance can be the same.

    Greets
    Kobe
     
  5. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Yes, that's right.
     

Share This Page