Coding Thread, MySQL Master-Master Replication in Coding and Web Development; I've got MySQL master-master replication setup fine on two servers. I was wondering if theres a solution to this, if ...
31st December 2008, 03:33 PM #1
MySQL Master-Master Replication
I've got MySQL master-master replication setup fine on two servers. I was wondering if theres a solution to this, if one server goes down it ends up out of sync with the other server. Is there any way automatically on startup for it to try and get up to date with the other server.
I know i could do that manually but it would be time consuming and ideally i would like it to be automated.
IDG Tech News
31st December 2008, 04:20 PM #2
Dare I ask why a 14 yr old boy has a domain name with his DNS pointing to a "server" he has hosting off his BT broadband and is asking about MySQL load balancing?
Anyway, I would got for the Master\Slave approach. I'm guessing your two server can't working out who actually is correct.
PS: Look at prgmr.com, assuming you fancy Linux.
31st December 2008, 04:29 PM #3
Didn't you do something similar at that age?
Originally Posted by matt40k
How else is the 14 yr old boy going to learn?
31st December 2008, 04:34 PM #4
Well I didn't have it open to people on the internet.
We'll ignore the fact I had a colo'd server when I was 17.
31st December 2008, 04:39 PM #5
He's trying to learn and there's no faulting him in that.
31st December 2008, 04:45 PM #6
I think your missing my point. Let me recap my points so far.
1/ I've recommend Master\Slave rather then Master\Master, you normally require high end kit for this (load balancing)
2/ I stated running stuff of your broadband is a bit foolish. (Do you want a list?)
3/ I stated a CHEAP vps provider which is a great way to learn, easy to restore your mistakes and keeps your home broadband secure.
31st December 2008, 04:51 PM #7
No, I'm perfectly clear in the points made, just think the way they were conveyed was a little off.
1/ Fair point.
2/ To learn, why pay for the pleasure on a remote system if you don't need to.
3/ A VPS provides no more functionality than one can achieve on their own boxes at home; but the comment about broadband is sound if availability is important otherwise it isn't.
31st December 2008, 05:12 PM #8
I totally agree people who have strong interest in IT. However some limits should be made.
I've had a cobalt webserver which was great, it's pretty straight forward and has loads of people who have created scripts that help automate it, plus you could pick one up cheap and hosting it in a london datacenter was around £10. Can't get anything less then £30 + VAT nowadays.
One of the main things about having a internet based server (dedi\colo\vds) is that it's open 24/7 and WILL get attacked from the outside. How well his firewall is setup is another thing.
One thing he is going to learn about is email. His currently got it on his home "server", which is a mistake for two reasons. One spam (open relay) and the amount your gonna get without some good rules and two, what happens when your server\internet goes down? I know companies that blacklist your MX servers if they are offline too long.
This is before we start on BT and there love bandwidth limiting \ caps.
Bah... anyway, mysql > master\slave
Openbsd > pf > load balance
31st December 2008, 05:19 PM #9
I take on what you're saying but in "our day" perhaps things were perhaps more economically viable, but given he's not hosting anything commercial requiring a high uptime etc there's no harm in playing how he is now.
He's yet to learn about open relays, blacklisting, null routing etc and the only way he'll learn is when it happens to him; or when he asks questions here and people with experience post back and help him.
I think we both share a similar view and that when funds permit he should look at a VPS or so initially to start with but until then, he can continue to play with his implementation as is until he hits problems.
31st December 2008, 09:37 PM #10
It isnt specifically for load-balancing. But in master-slave i cant write to the database if the master is down can i?
I prefer having the stuff hosted at home i'm not doing anything requiring high-bandwidth so its fine. The mail server itself is also fine, ive checked it and its not an open relay, and all my mail is relayed through BT's mail servers so i don't get mail blocked.
31st December 2008, 10:57 PM #11
- Rep Power
Have you looked at the MySQL clustering edition, if your after load balancing *and* failover thats is your answer.
Master/Slave(s) replication is pretty much for performance only and performing tasks such as backup without affecting the master.
Master/Master is impossible as far as I'm aware, (I'm guessing what you really mean is clustering).
The only other solution I can think of would be to use a heartbeat and switch the slave to master when the heartbeat fails (so it can accept updates).
Don't know about the last option, but clustering should be documented on the mysql website.
31st December 2008, 11:09 PM #12
Master Master is possible.
I'll have a look about clustering
31st December 2008, 11:56 PM #13
- Rep Power
I can see what you mean about master->master, its really just two master/slave combinations in opposition to each other. Each machine is both master and slave, master 1 sending updates to slave 2, slave 1 accepting updates from master 2. Both master and slave sharing the same tables on the same machine. Can't see how you would get around collisions with autonumbers though?
I might have a read later on.
2nd January 2009, 11:59 AM #14
From what little I know, in the master>master setup you would have to setup the failed server up as a slave, get it to sync, then turn it back into a master. I suppose you could have it setup as a slave on startup (mysql service), then have another one which switches back to a master once it's sync (manually ran)
Basically when the server comes back online it thinks it's right, when it isn't. You either have to tell it's wrong or setup heartbeat\CARP
The heartbeat is the load balancing which starts to hit the enterprise ed. (i think). I think CARP would do it.
By FN-GM in forum Windows
Last Post: 18th March 2010, 11:28 AM
By HMCTech in forum Educational Software
Last Post: 28th May 2008, 07:12 PM
By thomazo in forum Network and Classroom Management
Last Post: 29th June 2007, 01:23 PM
By cheesypete in forum General Chat
Last Post: 8th May 2007, 02:40 PM
Last Post: 1st April 2007, 01:06 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread