Unix Technical Forum

Master -> Slave/Master -> Slave problem.

This is a discussion on Master -> Slave/Master -> Slave problem. within the MySQL General forum forums, part of the MySQL category; --> I'm working with two distinct databases on four different boxes. Databases A on Server A needs to be present ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:48 AM
Gary W. Smith
 
Posts: n/a
Default Master -> Slave/Master -> Slave problem.

I'm working with two distinct databases on four different boxes.
Databases A on Server A needs to be present everywhere (Server B, C and
D). Database B needs to be present on Server C.

So I setup replication from Server A to Server B and Server D and then I
setup replication from Server B to Server C (to include the tables that
were replicated from Server A).

So when a change is made in Database A I see it roll over to B and C.
But nothing replicated to B ever gets re-replicated to D. It would be
optimal if I could slave from two distinct masters but from reading this
doesn't seem possible.

Server A:

log-bin=/datastore/mysql-log/repl
binlog-do-db=clients
server-id=1

Server B:

log-bin=/datastore/mysql-log/repl
binlog-do-db=clients
binlog-do-db=datastore

server-id=21
master-host=testdba.local
master-user=testdbareader
master-password=passworda
master-connect-retry=60
replicate-do-db=clients

Server C:

server-id=22
master-host=testdba.local
master-user=testdbareader
master-password=passworda
master-connect-retry=60
replicate-do-db=clients

Server D:

server-id=24
master-host=testdbb.local
master-user=testdbbreader
master-password=passwordb
master-connect-retry=60
replicate-do-db=clients
replicate-do-db=data

what can I do to fix this?

Gary
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 05:48 AM
Filip Krejci
 
Posts: n/a
Default Re: Master -> Slave/Master -> Slave problem.

Hi,

on server B you need to set log-slave-updates to pass statements from A
over B to D.

BTW: I can recommend you to use replicate-wild-do-table=db_name.*
instead of replicate-do-db, otherwise statements with db prefix before
tables won't replicate over B to D. RTM please


Filip

> I'm working with two distinct databases on four different boxes.
> Databases A on Server A needs to be present everywhere (Server B, C and
> D). Database B needs to be present on Server C.
>
> So I setup replication from Server A to Server B and Server D and then I
> setup replication from Server B to Server C (to include the tables that
> were replicated from Server A).
>
> So when a change is made in Database A I see it roll over to B and C.
> But nothing replicated to B ever gets re-replicated to D. It would be
> optimal if I could slave from two distinct masters but from reading this
> doesn't seem possible.
>
> Server A:
>
> log-bin=/datastore/mysql-log/repl
> binlog-do-db=clients
> server-id=1
>
> Server B:
>
> log-bin=/datastore/mysql-log/repl
> binlog-do-db=clients
> binlog-do-db=datastore
>
> server-id=21
> master-host=testdba.local
> master-user=testdbareader
> master-password=passworda
> master-connect-retry=60
> replicate-do-db=clients
>
> Server C:
>
> server-id=22
> master-host=testdba.local
> master-user=testdbareader
> master-password=passworda
> master-connect-retry=60
> replicate-do-db=clients
>
> Server D:
>
> server-id=24
> master-host=testdbb.local
> master-user=testdbbreader
> master-password=passwordb
> master-connect-retry=60
> replicate-do-db=clients
> replicate-do-db=data
>
> what can I do to fix this?
>
> Gary
>



--
Filip Krejci <krejcif@gmail.com>

Q: How many Linux users does it take to change a lightbulb?
A: Two. One to write the HOWTO-LIGHTBULB-CRONJOB, and another to read it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 05:48 AM
Gary W. Smith
 
Posts: n/a
Default RE: Master -> Slave/Master -> Slave problem.



> You should have:
> log-slave-updates
>
> on the slave/master host(s)
>
>
> Best regards,
> Irek Slonina


Irek,

Thanks for the follow up. Someone else has mentioned it but I just noticed that it was offlist.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 05:48 AM
Gary W. Smith
 
Posts: n/a
Default RE: Master -> Slave/Master -> Slave problem.

> Hi,
>
> on server B you need to set log-slave-updates to pass statements from

A
> over B to D.
>
> BTW: I can recommend you to use replicate-wild-do-table=db_name.*
> instead of replicate-do-db, otherwise statements with db prefix before
> tables won't replicate over B to D. RTM please
>
>
> Filip
>


Filip,

Someone sent me the log-slave-updates offlist and I managed to get it
working. I will definitely explore the replicate-wild option. This is
purely a test environment at this time.

Thanks,

Gary
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:22 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com