DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st May 2008
businessgeeks businessgeeks is offline
New User
 
Join Date: May 2008
Posts: 9
Default MySQL High Availability FreeBSD Cluster

Hi,

My boss has asked me to build a High Availability FreeBSD MySQL cluster so Im trying to research on guides or howtos to do it in FreeBSD 7.0. I've been reading that I need to use heartbeat to achieve high availablity. is this enough?

How will i able to keep the database information between each node sync?

Any helpful hints or links would be great.

Thanks in Advance..
Reply With Quote
  #2   (View Single Post)  
Old 21st May 2008
stukov's Avatar
stukov stukov is offline
Real Name: Jean-Michel Philippon-Nadeau
Package Pilot
 
Join Date: May 2008
Location: Sherbrooke, Qc, Canada
Posts: 167
Default

Hello businessgeeks,

I in process of building such a cluster. I will eventually write such a procedure after everything is working + tested. In fact, there are many ways to achieve such a task. What task will your cluster be built for? How critical is your application? What resources do you have (hardware, time)?

Heartbeat is only a part of the solution. You will also need to replicate your data from one machine to another. There are multiple ways to do this. You can setup basic replication between your MySQL nodes. You can also build a fancy MySQL Cluster (separates data from management and from API nodes). This approach is much more scalable but a little more costly on the resources side. I recommend you check out those links:

http://dev.mysql.com/doc/refman/5.0/en/replication.html
http://dev.mysql.com/doc/refman/5.0/...l-cluster.html

Once all your nodes have the same data, you can check out heartbeat, carp and even MySQL on how to switch from one machine to the other in case of failure or on how to distribute the load as evenly as possible.

Let me know if you have any questions.
__________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
Reply With Quote
  #3   (View Single Post)  
Old 22nd May 2008
businessgeeks businessgeeks is offline
New User
 
Join Date: May 2008
Posts: 9
Default

Hi Stukov,

Thank you for the reference links. It would seem that a mysql cluster is the way to go since im still in the R&D stage. If you dont mind, I'd like to ask some follow up quesions but to answer your questions:

1. The cluster will be hosting a localize version of youtube so availablility and performance are both being targetted here.
2. currently im in R&D stage so im pretty much playing around with a set of boxes.

Here are my questions.

1. Can you provide references on how to setup heartbeat, carp (what is carp anyway?) in a freebsd system?
2. Are there alternatives to replication, I friend told me to check out DBRD but says its linux only.

Im also looking into building a High Availability and Hi performance Web Server, and I hear this can be done with heartbeat alone, is this correct? will this setup work with lighttpd?

Regards,

BusinessGeeks
Reply With Quote
  #4   (View Single Post)  
Old 22nd May 2008
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Default

Quote:
Originally Posted by businessgeeks View Post
Here are my questions.

1. Can you provide references on how to setup heartbeat, carp (what is carp anyway?)
CARP is the Common Address Redundancy Protocol. It was developed by the OpenBSD team as an alternative to HSRP and VRRP, both of which are patent-encumbered. It has been ported since to FreeBSD and NetBSD... and 'ported' to userland as UCARP.

You can read more about CARP here (wikipedia explanation) and here (from counterseige). Most appropriate for FreeBSD users, however, is the likely this link.
__________________
Network Firefighter
Reply With Quote
  #5   (View Single Post)  
Old 22nd May 2008
stukov's Avatar
stukov stukov is offline
Real Name: Jean-Michel Philippon-Nadeau
Package Pilot
 
Join Date: May 2008
Location: Sherbrooke, Qc, Canada
Posts: 167
Default

Quote:
Originally Posted by businessgeeks View Post
The cluster will be hosting a localize version of youtube so availablility and performance are both being targetted here.
Cool. Is your cluster only a MySQL cluster or is it also an HTTP cluster?

Quote:
Originally Posted by businessgeeks View Post
Are there alternatives to replication, I friend told me to check out DBRD but says its linux only.
You won't need this if you go with the MySQL Cluster solution. You data nodes will take care themselves of being an exact replica of the other nodes.

Quote:
Originally Posted by businessgeeks View Post
Im also looking into building a High Availability and Hi performance Web Server, and I hear this can be done with heartbeat alone, is this correct? will this setup work with lighttpd?
Are you look forward to build two separate clusters or one server running multiple-services?

Correct me if I'm wrong, but I think heartbeat can't balance the load between your nodes. But I heard it works great for high-availability purposes. For your high-availability and high-performance need, I would suggest you try something with PF and CARP. This is what I am currently working on.
__________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
Reply With Quote
  #6   (View Single Post)  
Old 26th May 2008
marco64 marco64 is offline
Real Name: Marco
Port Guard
 
Join Date: May 2008
Location: Italy
Posts: 15
Default

Quote:
Originally Posted by businessgeeks View Post
Here are my questions.

1. Can you provide references on how to setup heartbeat, carp (what is carp anyway?) in a freebsd system?
2. Are there alternatives to replication, I friend told me to check out DBRD but says its linux only.

Im also looking into building a High Availability and Hi performance Web Server, and I hear this can be done with heartbeat alone, is this correct? will this setup work with lighttpd?

Regards,

BusinessGeeks

heartbeat; installs from ports
(Version 2 is not really what you need if not using python client)

install it on both servers and then set this minimum in ha.cf

file /usr/local/etc/ha.cf:

logfile /var/log/ha-log
keepalive 2
deadtime 10
bcast eth0 # name of the ETH you have
# you should have 2 ETH so that HA controls don't go on service's ETH
node server2
node server1

edit /etc/hosts

# handle so that the 2 severs know each other
ip_srv_2 server2
ip_srv_1 server1

handle so that Apache binds on cluster's IP (Apache will only run if the node is set as active) later you could sync the apache's files in /var/www or /usr/home's dirs. I suggest to use csync2 to do this.

edit haresources

server1 192.168.0.100 (this is the cluster's ip) apache (or apache2)

start heartbeat on both servers.

that's all. Later you could handle it better ie:daemonizing logs, adding services, etc.

Don't know if LighHttpd works.

Last edited by marco64; 26th May 2008 at 10:03 PM.
Reply With Quote
  #7   (View Single Post)  
Old 24th June 2008
businessgeeks businessgeeks is offline
New User
 
Join Date: May 2008
Posts: 9
Default

Thanks for the inputs anyone. I am currently looking the recommendations.

I also came across MYSQL PROXY

http://forge.mysql.com/wiki/MySQL_Proxy

Anyone here has experience with it in FreeBSD?
Reply With Quote
  #8   (View Single Post)  
Old 24th June 2008
osman osman is offline
Real Name: osman
New User
 
Join Date: May 2008
Location: Lahore, Pakistan
Posts: 9
Default

I think you should also check hardware load balancers like Foundry, Alteon.
They are very reliable.

As now in mysql 5 you can have a master to master relation between mysql servers, so i guess now load balancing of read/write queries is same.

Later in mysql 4 people used to setup one master DB and other Slaves(read-only), so only read queries were load balanced.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
freebsd cluster how to t4y4n FreeBSD General 18 18th September 2008 06:11 PM
PC Weasel availability? ocicat Off-Topic 10 19th July 2008 07:48 PM
Mysql Cluster Questions . . Help! dcreatorx FreeBSD Ports and Packages 3 3rd July 2008 01:06 PM
How to compile MySQL in FreeBSD 7? invarbrass FreeBSD General 1 23rd May 2008 06:25 AM
mysql on freebsd 7 nijikon FreeBSD General 0 20th May 2008 12:47 PM


All times are GMT. The time now is 02:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick