+ Post New Thread
Results 1 to 14 of 14
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 ...
  1. #1

    Join Date
    Jan 2007
    Location
    Durham, UK
    Posts
    328
    Thank Post
    33
    Thanked 17 Times in 12 Posts
    Rep Power
    20

    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.

    Thanks
    Jack

  2. #2

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,407
    Thank Post
    368
    Thanked 639 Times in 521 Posts
    Rep Power
    158
    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.

  3. #3


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,690
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    Quote Originally Posted by matt40k View Post
    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.
    Didn't you do something similar at that age?

    How else is the 14 yr old boy going to learn?

  4. #4

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,407
    Thank Post
    368
    Thanked 639 Times in 521 Posts
    Rep Power
    158
    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.

  5. #5


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,690
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    He's trying to learn and there's no faulting him in that.

  6. #6

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,407
    Thank Post
    368
    Thanked 639 Times in 521 Posts
    Rep Power
    158
    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.

  7. #7


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,690
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    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.

  8. #8

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,407
    Thank Post
    368
    Thanked 639 Times in 521 Posts
    Rep Power
    158
    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

  9. #9


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,690
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    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.

  10. #10

    Join Date
    Jan 2007
    Location
    Durham, UK
    Posts
    328
    Thank Post
    33
    Thanked 17 Times in 12 Posts
    Rep Power
    20
    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.

  11. #11
    Jay
    Jay is offline

    Join Date
    Mar 2008
    Location
    Autocratic theocracy of Norfolk
    Posts
    71
    Thank Post
    3
    Thanked 4 Times in 4 Posts
    Rep Power
    14
    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.

  12. #12

    Join Date
    Jan 2007
    Location
    Durham, UK
    Posts
    328
    Thank Post
    33
    Thanked 17 Times in 12 Posts
    Rep Power
    20
    Master Master is possible.
    I'll have a look about clustering

    Search

  13. #13
    Jay
    Jay is offline

    Join Date
    Mar 2008
    Location
    Autocratic theocracy of Norfolk
    Posts
    71
    Thank Post
    3
    Thanked 4 Times in 4 Posts
    Rep Power
    14
    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.

  14. #14

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,407
    Thank Post
    368
    Thanked 639 Times in 521 Posts
    Rep Power
    158
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 18th March 2010, 10:28 AM
  2. Report Master - Carn
    By HMCTech in forum Educational Software
    Replies: 7
    Last Post: 28th May 2008, 06:12 PM
  3. different teachers on the master
    By thomazo in forum Network and Classroom Management
    Replies: 1
    Last Post: 29th June 2007, 12:23 PM
  4. Anyone got a BBC B / Master?
    By cheesypete in forum General Chat
    Replies: 9
    Last Post: 8th May 2007, 01:40 PM
  5. Browser Master Rogue
    By john in forum Windows
    Replies: 5
    Last Post: 1st April 2007, 12:06 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •