[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: How can I monitore a mirror mode?



Hello Diego, thanks for answering!

Well, I researched a little more and discover that I can manage this using a contextCSN, like this script:

$ cat check_ldap_replication.sh
#!/bin/bash
master=$1
slave=$2
dn="dc=bla,dc=com"

test1=`ldapsearch -LLL -x -h $master -b $dn -s base contextCSN`
test2=`ldapsearch -LLL -x -h $slave -b $dn -s base contextCSN`

if [ "$test1" == "$test2" ]
then
    echo -en "Ldap Servers ARE in sync\n"
    echo $master: $test1
    echo $slave: $test2
    exit 0
else
    echo -en "Ldap Servers are _NOT_ in sync\n"
    echo server1: $test1
    echo server2: $test2
    exit 2
fi

./check_ldap_replication.sh 172.18.40.15 172.18.40.16
Ldap Servers ARE in sync
172.18.40.15: dn: dc=ir7,dc=com,dc=br contextCSN: 20101001141241.335252Z#000000#001#000000 contextCSN: 20100929191405.243745Z#000000#002#000000
172.18.40.16: dn: dc=ir7,dc=com,dc=br contextCSN: 20101001141241.335252Z#000000#001#000000 contextCSN: 20100929191405.243745Z#000000#002#000000

Anyway, here are recorded for future reference :)

And, at last, the LDAP Tool Box project has a perl script that does this and also have thresholds about delay on replication, if you need.

Thanks a lot!


On Mon, Oct 4, 2010 at 3:18 PM, Diego Lima <lists@diegolima.org> wrote:
Hi Tiago,

Mirror Mode is a lot like syncrepl, except that both servers act like
Master and Slave simultaneously (you'll probably notice that you have
set up both the syncprov overlay and syncrepl directives). So, AFAIK
scripts that you'd use for syncrepl should work for monitoring a
multi-master setup using mirror mode.

2010/9/29 Tiago Cruz <tiago.tuxkiller@gmail.com>:
> Hello folks,
>
> I have 2 OpenLDAP 2.4.11 running as Mirror Mode very well.
>
> But I would like to make sure that everything was replicated how should be
> forever :) so I would like to write some script to monitor it.
>
> I've searched around web, but I only found some about LDAP 2.2 and 2.3
> (syncrep).
>
> Can you give me some tip about how I can do this?
>It also does performance monitoring (e.g. graphs of searches, binds,

> Many thanks!
>
> --
> -- Tiago Cruz
>
>
>



--
Diego Lima
http://www.diegolima.org



--
-- Tiago Cruz