PDA

View Full Version : Multiserver setup bug


Murder4Al
6th June 2009, 16:04
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

till
7th June 2009, 14:32
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.

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.

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

Murder4Al
7th June 2009, 15:12
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

Murder4Al
8th June 2009, 12:52
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

falko
9th June 2009, 16:27
If I'm not mistaking the multi-server setup assumes that each slave has a local MySQL server.

Yes, that's right.