On Tue, Nov 27, 2012 at 07:09:35PM +0900, rocketdive5@yahoo.co.jp wrote:
I would like to know whether there is the API or plugin which can detect what was replicated.
Not directly, though you could turn on 'stats' and 'stats2' logging which would show you the entries supplied by one server to another. If you have problems to diagnose then you will want at least that level of logging anyway.
It may be easier to find out what *was not* replicated. This script will show you the current state of each server:
------------------------------------------------------------ #!/bin/sh # # check-replication
PATH=/usr/local/bin:/usr/bin:/bin export PATH
SUFFIX=dc=example,dc=com
for host in host1.example.com host2.example.com host3.example.com ... do echo $host ldapsearch -LLL -x -H ldap://$host/ -b ${SUFFIX} -s base contextCSN done ------------------------------------------------------------
If everything is working then the set of contextCSN values you see should be the same on each server. The values look like this:
contextCSN: 20120127155755.195827Z#000000#001#000000 contextCSN: 20121129113523.045520Z#000000#003#000000
You can see an obvious date field at the start. The small integer near the end is the server ID of the server that initially received the update.
Given a contextCSN value you can find the entry that it relates to like this:
ldapsearch -x -H ldap://host1.example.com/ "(entryCSN=20121127112456.206198Z#000000#003#000000)"
You might want to try that against each server in the ring just to check that they all show you the latest entry.
If one server is lagging behind you will see an older datestamp in the contextCSN. You can then find the entries that it has not updated by querying the source server, something like this:
ldapsearch -x -H ldap://host2.example.com/ "(entryCSN>=20121127112456.206198Z#000000#003#000000)"
Note that I am making an assumption here that replication worked up to a given time and then stopped. This process will not tell you much about changes that got skipped due to bugs.
Before getting into this sort of detail I suggest you check that each server is actually making successful connections to those one each side when it comes up. Also, as Quanah says, make sure you are running a release that has the fewest possible number of known replication bugs.
Andrew