Setting up LDAP loadbalancing for Zarafa

From Zarafa wiki

(Difference between revisions)
Jump to: navigation, search
 
Line 99: Line 99:
* Start pen with the initscript
* Start pen with the initscript
 +
* Change the ldap_host in the Zarafa ldap.cfg to localhost and you are ready to use the loadbalancer
* Change the ldap_host in the Zarafa ldap.cfg to localhost and you are ready to use the loadbalancer
 +
 +
 +
== Status checking ==
 +
 +
Pen comes with a basic webinterface for status monitoring of the nodes and received connections.
 +
The webinterface is by default available on http://127.0.0.1/pen/penctl.cgi.
 +
 +
The admin interface should be connected to the control port of Pen to show the status.

Latest revision as of 13:48, 17 February 2012

When integrating Zarafa to an Active Directory or OpenLDAP server, the Zarafa server can only be connected a single LDAP server. In case there is a failure with this LDAP node, the Zarafa server will be unreachable.

To solve this single point of failure the a LDAP loadbalancer can be used with connects to two or more LDAP servers. For LDAP loadbalancing there different commercial and opensource solutions available.

A simple opensource loadbalancing tool which can used for this is Pen

This article describes how Pen can be configured for LDAP loadbalancing and High Availability for Zarafa. Pen is included in most repositories of Linux distributions.

Installation and configuration

  • Install Pen on your Zarafa server
  • Create the configuration file /etc/pen.conf
  • Add the following lines to this configuration file


#log file
LOGFILE=/var/log/pen.log

# control port
CONTROL=127.0.0.1:10080

# max connections
MAX_CONNECTIONS=500

# listen port
PORT=389

# number of backend servers
BACKEND=2

# IP address of a backend
SERVER1=10.0.0.10:389

# IP address of a backend
SERVER2=10.0.0.11:389
  • Replace the server addresses with the ip-addresses of the LDAP or AD servers
  • As pen doesn't come with an initscript, the following initscript can be used
#!/bin/bash

# pend: Start/Stop Pend
# chkconfig: - 80 10
# description: Pen is a light weight simple load balancer.
# pidfile: /var/run/pen.pid

. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
. /etc/pen.conf

LOCKFILE="/var/lock/subsys/pen"
PID=/var/run/pen.pid
PROG=/usr/bin/pen

RETVAL=0
start() {
   echo -n $"Starting Pend: "
   SERVER=`grep "^SERVER" /etc/pen.conf | cut -d= -f2`
   daemon $PROG -x $MAX_CONNECTIONS -p $PID -l $LOGFILE -C $CONTROL -S $BACKEND -r $PORT $SERVER
   RETVAL=$?
   echo
   [ $RETVAL -eq 0 ] && touch $LOCKFILE
   return $RETVAL
}
stop() {
   echo -n $"Stopping Pend: "
   killproc $PROG
   RETVAL=$?
   echo
   [ $RETVAL -eq 0 ] && rm -f $PID $LOCKFILE
   return $RETVAL
}
case "$1" in
   start)
      start
      ;;
   stop)
      stop
      ;;
   status)
      status pend
      ;;
   restart)
      stop
      start
      ;;
   *)
      echo $"Usage: $0 {start|stop|status|restart}"
      exit 1
esac
exit $?
  • Start pen with the initscript
  • Change the ldap_host in the Zarafa ldap.cfg to localhost and you are ready to use the loadbalancer


Status checking

Pen comes with a basic webinterface for status monitoring of the nodes and received connections. The webinterface is by default available on http://127.0.0.1/pen/penctl.cgi.

The admin interface should be connected to the control port of Pen to show the status.

Personal tools