Questions on replication?
Questions on replication?
am 23.02.2006 20:02:55 von subaruwrx88011
Hello,
I am very new to MySQL and just got done reading the replication
chapter in my reference manual. I kinda understand but I still don't
know if my scenario is going to work out. Here is my scenario.
I have 2 servers, A and B. A is the primary server and master in mysql.
B is the redundant server and the slave in mysql. A is replicating to
B. Now A fails and B becomes the primary server (still slave in
mysql?). A finally comes back up, but instead of switch primary status
from B back to A, A becomes the redundant server and B stays as
primary. Now, I need B to be master in mysql and A to be slave in
mysql.
I don't know if this can be done the way it needs to. If it can I
really don't need a step by step process unless someone is really
willing to give that to me. I just would like to know if this can be or
has been done.
Thanks in advance
Leon
Re: Questions on replication?
am 25.02.2006 12:27:38 von Jonathan
subaruwrx88011 wrote:
> Hello,
> I am very new to MySQL and just got done reading the replication
> chapter in my reference manual. I kinda understand but I still don't
> know if my scenario is going to work out. Here is my scenario.
>
> I have 2 servers, A and B. A is the primary server and master in mysql.
>
> B is the redundant server and the slave in mysql. A is replicating to
> B. Now A fails and B becomes the primary server (still slave in
> mysql?). A finally comes back up, but instead of switch primary status
> from B back to A, A becomes the redundant server and B stays as
> primary. Now, I need B to be master in mysql and A to be slave in
> mysql.
>
>
> I don't know if this can be done the way it needs to. If it can I
> really don't need a step by step process unless someone is really
> willing to give that to me. I just would like to know if this can be or
> has been done.
It can be done, but it involves some user intervention:
- copy the database from B to A
- make B master and A slave
- restart replication
Jonathan
Re: Questions on replication?
am 27.02.2006 19:00:12 von subaruwrx88011
Thanks for the reply.
How do you make B master in runtime or automatically?
When you restart the replication, do you have to restart both servers?
What goes into doing this?
Re: Questions on replication?
am 28.02.2006 18:43:03 von Jonathan
subaruwrx88011 wrote:
> Thanks for the reply.
>
> How do you make B master in runtime or automatically?
I do this manually in runtime (only if server B is already set to do
binary logging).
> When you restart the replication, do you have to restart both servers?
> What goes into doing this?
>
If you already configured both servers to keep a binary log you will not
have to reboot the servers.
See the manual for details:
http://dev.mysql.com/doc/refman/5.0/en/replication-howto.htm l
Steps you already configured need not be done again:
- As you already used replication server-id's are set at both servers.
- You might even have created a replication user on server B, if not you
will have to do so.
Jonathan