LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mysql slave replication question (https://www.linuxquestions.org/questions/linux-software-2/mysql-slave-replication-question-494597/)

muxman 10-22-2006 09:05 AM

mysql slave replication question
 
I want to set up master slave replication for a mysql database. I've found several howto's and it doesn't look hard to do but I have a some questions I haven't really seen answered directly and would like answered before I commit. I want this for redundancy and to eliminate downtime.

Q1
Once set up and replicating, when the master goes down all I would need to do is take the slave out of slave mode and make it a master and then continue as normal. Just moving it into the masters place since it's sync'd up to the time the master went down. Does this sound correct? Then a new slave can be placed to be the backup for this new master, the old slave?

Q2
Once set up in a master slave configuration can the slave be updated directly? What I'm thinking is yes it can, but that would take it out of sync with the master giving it unique data that master doesn't have. Which is not what I want.

Q3
If the slave does get a direct record input, like in Q2, would the next update from the master wipe that record out? For instance. I have the database I'm replicating with a table called "Addresses". It has an column named "index" that auto increments giving each record it's unique id to identify it, this field must not be null and must be unique, standard kind of thing. Someone adds a record that gets an index number of 350 directly on the slave. The next time the master replicates to the slave it replicates a record with the index number of 350 to the table named "Addresses", an entry which already exists on the slave because it was directly input when it shouldn't have been. Will the record coming from the master delete the existing one on the slave and put it's data into it? Or will the record already exisiting on the slave block the data from the master? Or will there be some other problem and the replication ceases due to an error?

I may have more questions later but these ones that are on my mind and I've been unable to get a clear picture from howto's and the mysql documention.

Thanks

nayyares 10-22-2006 12:38 PM

Hi,

The mySQL replication is so automated that it update its replication slave server automatically and when goes down it will adjust slave to master, my recommendation for you, is to use Altramonkey sort of load balancer if you have haveay data loads on your server.

I d'nt seem and hard setup in mySQL replication, its matter of few minutes, thanks

muxman 10-22-2006 07:49 PM

It's not that there is a heavy load, but that low downtime is critical. I want replication so that if the master goes down all we would have to do it start using the slave and downtime is limited to the time it takes you to use the different server address.

My questions I asked in the first post are just so I can understand how the replication works better for my own knowledge and so that I, in the cases like I mentioned, understand what's going on and what steps if any need to be taken next at that time.

Thanks for the suggestions. I'll take a look at those as well.


All times are GMT -5. The time now is 08:52 PM.