Linux - ServerThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have a couples of questions ,as i always get help when i need from this great forum discussion ,
i'm going to implement mysql replication for the first time on two servers through master-to-master in active-passive mode
and i want to use a load balancer software with this replication system
this load balancing software have the ability to configure easily without making any troubles to point or direct database writes to the active server not to the passive server
mean that i want a load balancer software which can direct apache web server read requests to server B (passive server) or to A (active server) if it is not busy, while only direct apache web server write requests to server A
my question is which load balancing software that will help me in this situation cuz there are alot ,like pen, LVS, or ultramonkey
load balancing will be on apache httpd server only beside right directing write or read from database
ps : i'm still begining my search on using replication so i still doesnt have or get the complete idea of replication & didnt start my search on any load balancer software untill i find the one that fit for my case
I have a similar environment setup with MySQL master-master replication and load balancing for websites that use either Tomcat or Apache, and it works great. I've used the ultramonkey package, being Heartbeat and ldirectord. The latter has been replaced by pacemaker but I still haven't upgraded (since it's working like it is there's no urgency).
I found it pretty easy to set the thing up but if you have questions just post them here and I'm sure someone will provide an answer.
I have a similar environment setup with MySQL master-master replication and load balancing for websites that use either Tomcat or Apache, and it works great. I've used the ultramonkey package, being Heartbeat and ldirectord. The latter has been replaced by pacemaker but I still haven't upgraded (since it's working like it is there's no urgency).
I found it pretty easy to set the thing up but if you have questions just post them here and I'm sure someone will provide an answer.
Kind regards,
Eric
Hello Eric ,,
thanks alot man for your answer ,
as i said before i'm just begining this project & still search on implementing it in a good way as much as i could , really Eric you helped me by your answer cuz now i know what software for loadbalancing that i will use ,please man if you have any source or articles that would help me in this project please post it cuz it will help me so much ,
& if i have any questions about a problem i will renew this thread
You're welcome! When I started with MySQL replication I got a lot of helpful information from this site: http://www.howtoforge.com. If you type MySQL Master Master in the search box of that site you'll see what I mean. All of the howtos on that site are easy to follow and you'll learn a lot of the workings by setting it up yourself.
And for the high availability and load balancing part you can check out this wiki: Linux HA which has all the necessary info or at least links to it.
You're welcome! When I started with MySQL replication I got a lot of helpful information from this site: http://www.howtoforge.com. If you type MySQL Master Master in the search box of that site you'll see what I mean. All of the howtos on that site are easy to follow and you'll learn a lot of the workings by setting it up yourself.
And for the high availability and load balancing part you can check out this wiki: Linux HA which has all the necessary info or at least links to it.
I'm using NAT here and not direct routing, so couldn't tell you what's preferred. NAT works in my environment.
About the number of nodes, you read the howto for a 4 node cluster. Here's one for two node cluster for Debian Etch (you can easily adapt it for your distro).
If you want to I can mail you my step-by-step guide for a two node cluster with MySQL master-master replication and Load Balancing on the webserver part. Just let me know and I'll send it to you. Mine also includes file synchronisation between the two nodes with Unison.
actually i jave read many articles & a book (some chapters from it) called Linux Cluster, but i feel that i still couldnt get the point yet
i thought that load balancer is installed on the same real server, not alone in another server , or maybe i still need some time to understand the whole idea
really man ,offerring me this guide is a very kind & great help from you ,& will help me better to get the point quickly
could you please man send it to my email address
again thank you man
& accept my best regards
Last edited by HuMan-BiEnG; 08-27-2010 at 12:57 PM.
You have the choice basically. At first when I set up the similar environment at work, I used two nodes just like you. I installed the HeartBeat package on both of them and set up the complete load balancing and MySQL master master replication on that cluster.
Later on as need arose to include other services to the load balancing scheme, I separated the load balancing from the two nodes (that were also the webservers) and installed and configured it on two separate servers.
At this time we have load balancing on 4 virtual services that have each 2 nodes (and two services with 4 nodes in the planning).
As you see you don't HAVE to install the load balancing part on the same servers or on separate ones, the choice is up to you.
I advice you to delete the email address from your post if you don't want to receive lots of spam. I already saved it so no problem there. And if you want to send an email to a LQ user you can do so by clicking on his/her username and select that option from the pull down menu.
As you see you don't HAVE to install the load balancing part on the same servers or on separate ones, the choice is up to you.
thanks Eric, as i told you i'm new in this project & this thing made me , but i got it know because of you man
Code:
I advice you to delete the email address from your post if you don't want to receive lots of spam. I already saved it so no problem there. And if you want to send an email to a LQ user you can do so by clicking on his/her username and select that option from the pull down menu.
sorry man ,i'm new to this kind of forums & we always get the advise & know the right thing to do from kind expert people like you Eric
& i will remove it now
Code:
I'll mail you the guide as soon as possible.
yeah man i got it, you really helped me so much in this new project & all i can say is that i hope that you will always be the best in every thing you want
i will study & read it very well beside what i got from howforge & the ebook linux cluster, to get the complete point
thank you good & kind Eric
& accept my best regards to you man
hope that everything with you is going very well ,,
actually you helped me so much & i read your file & learned & get the whole idea very well
but, i will use MASTER-MASTER Active-Passive not MASTER-MASTER Active-Active topology ,cuz of the problems that will be in MASTER-MASTER Active-Active as i'm not an expert in mysql, while i'm just system who is trying to live & work in the best way
you know that writes in mysql will be only in Active server, while reads will be in Passive server, & i want to know how to configure ultramonkey to direct write requests (to mysql) to Active server while directing read requests to both Active & Passive server ???
another question, about the physical network ,that heartbeat should use
what i will ask for the data center to do ?
connecting the two servers through serial cable or through Ethernet network card using cross cable ??
Can you clarify what problem in MySQL master master replication you are referring to when using an active-active setup? I've got that setup for over a year now with very little problems, so I'm curious to what you are referring to.
Also, what's the profit by using active-passive when all else is load balanced? I'm not the expert on MySQL neither but how do you write to one host and read from another? Isn't using MySQL on localhost for both web instances a more secure option? And consequently using the replication in an active-active environment more adequate to have high availability on all levels?
At least that's how I set it up, the only thing that gets load balanced in the environment as I set it up are the webserver sessions. The load balancer directs the web requests to the nodes, the nodes work on localhost level with MySQL, and the synchronisation between them is done as master master in an active-active.
If you want to set up a failover environment, so that only one server is active all the time and synchronize everything in a active-passive way, that's another case. But at that time you'll be writing and reading from the same database server and only replicating to the other to use in case the primary node fails.
Again, I'm not the MySQL expert so I'm all ears if I can learn something new.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.