From 389 Directory Server
Contents |
Configuring Multimaster Replication
Purpose
This document explains how to configure multimaster replication between Fedora and Redhat Directory Servers from the command line.
Requirements
- Two machines, each running Fedora Directory Server
- Password for "cn=directory manager" must be the same on both machines
- LDAP naming context must be the same on both machines
- The perl module Net::LDAP
- The old-mmr.pl *DEAD LINK*script
- The new packages following the FHS_Packaging (including the fedora-ds-base in Extras) don't define nsslapd-instancedir, so the newer mmr.pl*DEAD LINK* script is required
- Modified mmr.pl script that allows to utilize a port other than the default with the option "--port" (Both machines must utilize the same port).
Tail the error logfiles
Open a terminal on host 1 and tail the errors logfile:
$ tail -f /opt/fedora-ds/slapd-`hostname`/logs/errors
Open a terminal on host 2 and tail the errors logfile:
$ tail -f /opt/fedora-ds/slapd-`hostname`/logs/errors
Become familiar with mmr.pl
Check the documentation for the mmr.pl script:
$ ./mmr.pl --man
Configure and activate multimaster replication
Note that this step will initialize host2 (b.example.com) and overwrite any data on it!
Execute the mmr.pl script to configure and activate multimaster replication:
$ ./mmr.pl --host1 a.example.com --host2 b.example.com --host1_id 1 --host2_id 2 --bindpw secret --repmanpw secret --create
Watch the error logfiles for progress
The output in the host 1 error log should look similar to this:
[20/Nov/2005:00:20:05 +0200] NSMMReplicationPlugin - Beginning total update of replica "agmt="cn="Replication to b.example.com"" (b:389)". [20/Nov/2005:00:20:07 +0200] NSMMReplicationPlugin - Finished total update of replica "agmt="cn="Replication to b.example.com"" (b:389)". Sent 9 entries.
The output in the host 2 error log should look similar to this:
[20/Nov/2005:00:20:35 +0200] NSMMReplicationPlugin - agmt="cn="Replication to a.example.com"" (a:389): Replica has a different generation ID than the local data. [20/Nov/2005:00:20:36 +0200] NSMMReplicationPlugin - multimaster_be_state_change: replica dc=example,dc=com is going offline; disabling replication [20/Nov/2005:00:20:36 +0200] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database [20/Nov/2005:00:20:38 +0200] - import userRoot: Workers finished; cleaning up... [20/Nov/2005:00:20:39 +0200] - import userRoot: Workers cleaned up. [20/Nov/2005:00:20:39 +0200] - import userRoot: Indexing complete. Post-processing... [20/Nov/2005:00:20:39 +0200] - import userRoot: Flushing caches... [20/Nov/2005:00:20:39 +0200] - import userRoot: Closing files... [20/Nov/2005:00:20:39 +0200] - import userRoot: Import complete. Processed 9 entries in 3 seconds. (3.00 entries/sec) [20/Nov/2005:00:20:39 +0200] NSMMReplicationPlugin - multimaster_be_state_change: replica dc=example,dc=com is coming online; enabling replication
At this point, the two machines are replicating. If a change is made to machine 1, it will replicate to machine 2. If a change is made to machine 2, it will replicate to machine 1.
Display replication agreements
Execute the mmr.pl script to display replication agreements:
$ ./mmr.pl --host1 a.example.com --host2 b.example.com --bindpw secret --display
Remove replication agreements
Execute the mmr.pl script to configure and remove replication agreements:
$ ./mmr.pl --host1 a.example.com --host2 b.example.com --bindpw secret --remove
