| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-08-2012, 01:35 PM
|
#1
|
|
Member
Registered: Dec 2011
Posts: 73
Rep: 
|
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?
|
|
|
|
12-08-2012, 01:39 PM
|
#2
|
|
Member
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 531
Rep:
|
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.
|
|
|
|
12-08-2012, 03:03 PM
|
#3
|
|
Member
Registered: Dec 2011
Posts: 73
Original Poster
Rep: 
|
Quote:
Originally Posted by robertjinx
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)?
|
|
|
|
12-09-2012, 10:07 AM
|
#4
|
|
Member
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 531
Rep:
|
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.
|
|
|
|
12-09-2012, 01:40 PM
|
#5
|
|
Member
Registered: Dec 2011
Posts: 73
Original Poster
Rep: 
|
Quote:
Originally Posted by robertjinx
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
|
|
|
|
12-10-2012, 03:04 AM
|
#6
|
|
Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5
Posts: 537
Rep: 
|
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.
|
12-11-2012, 01:07 AM
|
#7
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 14,938
|
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)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:33 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|