Cluster

How To Install Repcached (Memcached Replication) For High-Availability Over 2 Nodes On Ubuntu 11.04

This is a copy/paste friendly tutorial so using putty will make this a lot easier.

This how to will show you how to install and build memcached with replication, create a startup script and configure PHP to use memcache for sessions rather than storing them as files. This tutorial assumes you have set up 2 servers to replicate the information over.

1. My Setup

I will be setting up repcache on 2 hosts, they will have both lighttpd and repcache installed on them.

Web Server 1: server1.example.com, IP Address: 10.10.20.10; This will be refered to as server1.
Web Server 2: server2.example.com, IP Address: 10.10.20.11; This will be refered to as server2.

2. Installing repcache

apt-get install libevent-dev g++ make

can continue the installation

tar xvf memcached-1.2.8-repcached-2.2.tar
cd memcached-1.2.8-repcached-2.2/
./configure --enable-replication
make
make install

3. Configuring repcache

Repcache is now installed, binary location is /usr/local/bin/memcached. From here we will create the config file and startup script. Config file and init script are the ones found on MarcusSpiegel’s howto. Do this on both nodes.

vi /etc/memcachedrep

This IP will be the other server you wish to replicate to

Continue reading “How To Install Repcached (Memcached Replication) For High-Availability Over 2 Nodes On Ubuntu 11.04” »

Be the first to comment - What do you think?  Posted by Aniruddh - November 9, 2011 at 9:38 pm

Categories: Cluster, High Availability, Ubuntu   Tags:

How To Use pfSense To Load Balance Your Web Servers

This HowTo assumes that you already have a pfSense box and at least 2 Apache servers installed and running on your network, and that you have some pfSense knowledge.
Requirements
1 Box for pfSense 2.0 installation (if this is your edge firewall I would recommend a physical machine).

Minimum of 2 Apache2 servers (these can be virtual).

Configuring pfSense
To add a new entry click on the “Plus” button, specify a “Name” and a “Description” (in this example I will be using ApacheClusterMon as a name and description), set the type to “HTTP” then set the “Host” to an unused IP address (we will be creating virtual server IPs later on that will be assigned to the failover server group), leave the “HTTP Code” set to “200 OK”. Then click on “Save” and apply changes

Click on the “Pools” tab, and click the “Plus” button to add a new pool.

Specify a name ( ApacheSrvPool will be used in my example). Set the “Mode” to “Load Balance”, then set the “Port” to “80″ (you can get pfSense to load balance other applications on other ports), set “Monitor” to the monitor configuration you created before and specify the IP addresses of all the web servers that you want in the pool, “Save” and apply changes if required

Continue reading “How To Use pfSense To Load Balance Your Web Servers” »

Be the first to comment - What do you think?  Posted by Aniruddh - November 2, 2011 at 7:52 pm

Categories: Cluster, Load Balancing, Web Server   Tags: