small-scale clustering
Matt Shields
matt-urrlRJtNKRMsHrnhXWJB8w at public.gmane.org
Tue Aug 31 11:17:15 EDT 2010
On Tue, Aug 31, 2010 at 11:05 AM, Tom Metro <tmetro-blu-5a1Jt6qxUNc at public.gmane.org> wrote:
> Mark Woodward wrote:
> > Two cheap computers, both well able to keep up with being
> > "slash-dotted." A direct wire between the two of them for replication
> > and synchronization. Full fail-over with a load balancer.
>
> I'd be curious to hear more about this setup.
>
> What are you using to implement replication and database synchronization?
>
> Do you use any shared storage, or does each system have local disks and
> rely on replication?
>
> What are you using for a load balancer?
>
> (Consider that if you could rent a load balancer "in the cloud" -
> someplace with high reliability and redundant connections - cheaply
> enough, you could then place each of your cheap computers on separate
> cheap net connections, at separate locations, and achieve pretty good
> redundancy for low cost. Of course replace "load balancer" with some
> simple automation to update your DNS when the primary server becomes
> unreachable, and you're pretty much there.)
>
> Are you using virtualization?
>
> -Tom
>
> --
> Tom Metro
> Venture Logic, Newton, MA, USA
> "Enterprise solutions through open source."
> Professional Profile: http://tmetro.venturelogic.com/
> _______________________________________________
> Discuss mailing list
> Discuss-mNDKBlG2WHs at public.gmane.org
> http://lists.blu.org/mailman/listinfo/discuss
>
If you were tight on hardware I've setup a solution like the following.
2 Servers both running full LAMP stack. MySQL was setup with Master-Master
replication, deployed webcontent is rsync'd to both machines. Each local
apache contacts localhost for it's mysql connection. Linux-HA
(ldirectord,ipvsadmin,heartbeat) is run on both nodes so one server is
master, one is slave. Master server has the VIP and takes about 40% of
traffic locally, 60% of the traffic get's passed to the secondary node.
During a failover the roles are reversed. Create a simple load balancer
test page that queries the DB and when expected result is not there (some
type of MySQL error, etc) it pulls that node out of load balancer.
Things to keep in mind are if you have user sessions, you should keep them
in the database or create sticky sessions on the load balancer. Also, if
you have uploadable content like when you have a wordpress blog, that will
only end up on one node, so either put it in a database (no efficient) or
create a process that's constantly pushing rsync's between the servers (can
be problematic), or shared storage. One thing I would hesitate having one
server serve the directory as an NFS share to the other, because if that
server dies, you've lost your shared content.
Also, with MySQL master-master, you need to be very careful about your
tables. Need to have auto incrementing primary keys on all tables, whether
you need them or not. And you need to use a special my.cnf that overrides
incrementing keys by 1, instead you increment by 10.
-matt
More information about the Discuss
mailing list