LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-08-2012, 01:35 PM   #1
circus78
Member
 
Registered: Dec 2011
Posts: 113

Rep: Reputation: Disabled
mysql replication?


hi.
I've two server in order to build a little mysql-cluster.
What's the mean difference between "master-master" and "master-slave" model?
Which is better, if my first goal is redundancy?
 
Old 12-08-2012, 01:39 PM   #2
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 561

Rep: Reputation: 58
I guess master-master, as master-slave you can only use the master. The slave is there to have a copy of the master and can only be used for reading, but not writing, but thats only me.

You can maybe do a failover cluster, but this way you always use only one server.
 
Old 12-08-2012, 03:03 PM   #3
circus78
Member
 
Registered: Dec 2011
Posts: 113

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by robertjinx View Post
I guess master-master, as master-slave you can only use the master. The slave is there to have a copy of the master and can only be used for reading, but not writing, but thats only me.

You can maybe do a failover cluster, but this way you always use only one server.
Hi robertjinx, thank you for your reply.
How can I manage the ip address issue? For my web applications, webmail, and CMS, I've to specify an unique ip address of course.
Should I use thirdy party solution for balacing? Or there is another way (without "external" tools)?
 
Old 12-09-2012, 10:07 AM   #4
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 561

Rep: Reputation: 58
Exactly don't know, but if you want to have both master then you'll need to HAE setup and a shared ip address. Never did this myself, only the master-slave idea, so you'll need to search on google.
 
Old 12-09-2012, 01:40 PM   #5
circus78
Member
 
Registered: Dec 2011
Posts: 113

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by robertjinx View Post
Exactly don't know, but if you want to have both master then you'll need to HAE setup and a shared ip address. Never did this myself, only the master-slave idea, so you'll need to search on google.
Hi, ok, just one last question: how do you split write/read task on your two mysql server?
Do you use only such application with native mysql-cluster support? Or "by hand" (for eg. on some application you put x.x.x.x address and on other y.y.y.y)?

Thank you again
 
Old 12-10-2012, 03:04 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,398

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
Some points to be aware of:

If you are going to use a "master-master" setup (circular replication) then you must make sure that the application you are writing/using will work correctly. Auto-incremented values are the main problem, you will need to ensure that you change the auto-increment from 1 to n, where n is the number of servers you have.

If you want to use "master-master" or "master-slave" for load balancing then you'll need to ensure that your application also supports this correctly, especially if you are writing critical data. For example, if you are storing financial data you will need to ensure that after you write data that this change is accurately reflected across all the servers. MySQL replication is rather loosely coupled, writes are stored in a log and it is up to the other servers to read from this log and update themselves apropriately. So if you're using two servers and write to server A you need to then ensure that you read server B and if necessary you may have to wait to get back the data you have just written.

As for doing the actual load splitting, you can either have your application do the balancing based on rough criteria such as if the last octet of the client IP is odd then use server A, if it's even then use server B. Alternatively you could use a load balancing appliance (for example a Citrix NetScaler) in-front of your servers.

For basic web applications unless you're doing silly amounts of page views or transactions then a well specified server should be able to cope with loads while using a replication target for backup.

As an example, my personal websites does around 1.4 million page views off a single MySQL server with master-slave replication but no need to load balance.
 
1 members found this post helpful.
Old 12-11-2012, 01:07 AM   #7
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Can I just point out that Clustering and Replication are 2 completely separate methodologies.
You need to start by deciding which one you want.
(Master-Master Replication is not the same as Clustering, although superficially it looks similar)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql replication failed after mysql reboot ajayan Linux - Newbie 8 09-08-2010 11:00 AM
MySQL replication Ammad Linux - General 1 09-16-2009 08:46 PM
MySQL replication Padawan.AVT Linux - Server 4 06-16-2009 09:27 PM
mysql replication twistedpair Linux - General 7 06-23-2006 10:10 AM
mysql replication cheng Linux - Software 1 08-22-2002 02:11 PM


All times are GMT -5. The time now is 02:46 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration