MySQL Forums
Forum List  »  Replication

Quick replication questions
Posted by: Mauricio Tavares
Date: March 22, 2011 12:38PM

I just want to make sure what I am doing here makes sense. So, let's say we have two db servers, db1 (master) and db2 (slave)

Q1: Is it a good idea to have read-only set in the slave while it is replicating?

Q2: If db2 is to become master, I guess I should do

set global read_only = off;
reset master;

Now, in its my.cnf, would it suffice to comment out the read-only entry and all the master- entries so if db2 reboots it would still be in master mode?

Q2.2: A bit off topic, but should I set read_only = on when doing a mysqldump or would passing "--master-data --all-databases --add-drop-database" suffice? In http://dev.mysql.com/doc/refman/5.1/en/replication-solutions-backups-read-only.html they seem to imply that you should set read_only = on before taking a dump.

Q3: Let's say the initial dump you provided to db2, as you configured it to be a slave, was associated to, say, mysql-bin.00123 log file and 00123 log file position in db1. But by the time you have db2 ready to start slave, the master log file is now mysql-bin.00234. Would it matter or it would be just a matter for db2 to catch up?

Q4: As you create the initial dump mentioned in Q3, if you flush tables with read lock on db1 before creating it (just to make it easier to copy the log filename and position), do you need to keep the lock until you start replicating on db2?

Options: ReplyQuote


Subject
Views
Written By
Posted
Quick replication questions
3460
March 22, 2011 12:38PM
1028
March 23, 2011 07:56PM
880
March 24, 2011 10:28PM
872
March 25, 2011 06:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.