Solved

Auto replicate Ubuntu Server (Linux) on Second Box?

Posted on 2013-01-10
2
467 Views
Last Modified: 2013-02-14
My org. is going to launch a public facing Drupal site running on Ubuntu Server)

As part of a load balancing and backup strategy, one of the options we want to explore is having the (A) server auto replicate constantly on (B) server.

So if (A) crashes, (B) immediately takes over.

So...what's the best practice for this?

Note:  1) I'm running all this virtually in a VMare environment and 2) the MySQL is on it's own server.
0
Comment
Question by:sandshakimi
2 Comments
 
LVL 117

Assisted Solution

by:Andrew Hancock (VMware vExpert / EE MVE)
Andrew Hancock (VMware vExpert / EE MVE) earned 250 total points
ID: 38762914
0
 
LVL 12

Accepted Solution

by:
junipllc earned 250 total points
ID: 38763359
There is a tag in this question for Drupal, so Drupal dude reporting in.

There are a number of ways to do this for Drupal, and it depends on which version you are using, and what features the site has. Since you are on a local network and not doing this across the WAN it's a bit easier.

Off the top of my head, you'll need:
 - a shared file system (GlusterFS, NFS, CIFS)
 - either DRBD/Heartbeat or a reverse proxy / load balancing server (Apache works for this)
 - depending on how you implement this (two live servers vs. one live and one hot standby) you may need sticky session support (easy in Apache)
 - I would always replicate the database regardless of whether you are using the same MySQL box for everything
 - no single point of failure.

Are you also concerned about scaling? If so, certain approaches are better than others, and this one may be the way to go:

In your situation (with the limited knowledge I have so far) I'd use two Apache reverse proxies with load balancing and sticky sessions (mod_proxy, mod_proxy_http, mod_proxy_balancer), placed into an HA group (DRBD/Heartbeat is good for this). You'll have a "floating" IP address that moves between the proxy servers should one of them crash.

Then I'd have server A and server B set up behind the proxy as the "members" of the load balancer. You can add additional servers at will (server C? server D? server Z?).

The shared file system will keep the machines in sync since there is only one place where the data lives; however, this introduces a possible single point of failure. You may also want to consider rsync (good for smaller sites) or unison if you want to keep duplicate copies of the files on each server. I believe Gluster will take care of replication automatically, but I have limited experience with it.

The database should be replicated to at least one other machine for backup, or for scalability (using one server for reads and another for writes). Back up your database. Often.

This attains the goal of backup (in the hosting sense) and load balancing. If server A were to crash, Apache will automatically remove it from the group of active servers, and server B would take over the additional traffic. Same goes with 3, 4, or 20 servers.

Again, there are other ways to do it, and there may be a better, more up-to-date way, but I know this is tried-and-true for Drupal and Ubuntu.

Cheers!

Mike
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now