To bring up a replica slapd instance, you must configure the master and slave slapd instances for replication, then shut down the master slapd so you can copy the database. Finally, you bring up the master slapd instance, the slave slapd instance, and the slurpd instance. These steps are as follows (you can set up as many slave slapd instances as you wish):
Install the slapd software on the host which is to be the slave slapd server. The configuration of the slave server should be identical to that of the master, with the following exceptions:
In order to ensure that the slave starts with an exact copy of the master's data, you must shut down the master slapd. Do this by sending the master slapd process an interrupt signal with kill -TERM pid, where pid is the process ID of the master slapd process.
If you like, you may restart the master slapd in read-only mode
while you are replicating the database. During this time, the master
slapd will return an unwilling to perform error to
clients that attempt to modify data.
Copy the master's database(s) to the slave. For an LDBM-based database, you must copy all index files as well as the NEXTID file. Index files will have a different suffix depending on the underlying database package used. The current possibilities are as follows:
You should copy all files with such a suffix that are located in the index directory specified in your slapd configuration file.
To configure slapd to generate a replication logfile, you add a replica configuration option to the master slapd's configuration file. For example, if we wish to propagate changes to the slapd instance running on host caymen.rs.itd.antbear.com:
replica host=cayman.rs.itd.antbear.com:389
binddn="cn=Replicator, o=Antbear, Lucid & Popp, c=US"
bindmethod=simple credentials=secret
In this example, changes will be sent to port 389 (the standard
LDAP port) on host cayman. The slurpd
process will bind to the slave slapd as ``cn=Replicator,
o=Antbear, Lucid & Popp, c=US'', using simple authentication with
password secret. Note that the entry given by the binddn
directive must exist in the slave slapd's database (or be the
rootdn specified in the slapd configuration file) in
order for the bind operation to succeed.
Restart the master slapd process. To check that it is generating replication logs, perform a modification of any entry in the database, and check that data has been written to the log file.
Start the slurpd process. slurpd should immediately send the test modification you made to the slave slapd. Watch the slave slapd's logfile to be sure that the modification was sent.
slurpd -f masterslapdconfigfile