Bismillah,
its supposed to post this article a few months ago
here I will explain about centos multimaster replicating.
first the scenario, you have two server as a High Availability for LDAP server.
before we do a replication make sure both server can connect each other.
please setup you hostname.
1st server:
hostname = kura1.com
ip-addr = 10.10.10.202
2nd server:
hostname = kura2.com
ip-addr = 10.10.10.16
make sure at /etc/hosts have this. or at your DNS server.
install the package at 1st server:
I'm using Centos 5.8 as a server.
yum install centos-ds* --enablerepo=extrasbuild the directory server.
setup-ds.plmy database name is slapd-kura1 my Directory Manager password is secret fill the Directory Manager password, 1. create replication manager, copy this and named as 1_replicating_manager.ldif put in /tmp/
dn: cn=replication manager,cn=config objectclass: inetorgperson objectclass: person objectclass: top objectclass: organizationalPerson cn: replication manager sn: replication manager userpassword: password nsIdleTimeout: 0next import that file.
cd /usr/lib64/slapd/slapd-kura1/ sh ldif2ldap -D "Directory Manager" secret /tmp/1_replicating_manager.ldif2. create changelog dir, save as 2_change_log.ldif
dn: cn=changelog5,cn=config objectclass: top objectclass: extensibleObject cn: changelog5 nsslapd-changelogdir: /var/lib/dirsrv/slapd-kura1/changelogdb nsslapd-changelogmaxage: 10dimport:
sh ldif2ldap -D "Directory Manager" secret /tmp/2_change_log.ldif3. create replica task, save as /tmp/3_replica_task.ldif
dn: cn=replica,cn=dc\3Dkura1\, dc\3Dcom,cn=mapping tree,cn=config nsDS5ReplicaType: 3 cn: replica nsDS5ReplicaBindDN: cn=replication manager,cn=config nsds5ReplicaPurgeDelay: 604800 nsDS5ReplicaRoot: dc=kura1, dc=com nsDS5ReplicaId: 8 objectClass: extensibleObject objectClass: top objectClass: nsDS5Replica nsds5ReplicaChangeCount: 1 nsDS5Flags: 1import:
sh ldif2ldap -D "Directory Manager" secret /tmp/3_replica_task.ldif4. create replica agreement from 202 to 16, save as /tmp/4_replica_agreement.ldif
dn: cn=XX202-XX202toXX016,cn=replica,cn=dc\3Dkura1\, dc\3Dcom,cn=mapping tree,cn=config cn: XX202-XX202toXX016 nsDS5ReplicaBindDN: cn=replication manager,cn=config description: from XX202 to XX016 nsDS5ReplicaRoot: dc=kura1, dc=com nsDS5ReplicaHost: kura2.com nsDS5ReplicaPort: 389 nsDS5ReplicaBindMethod: SIMPLE objectClass: top objectClass: nsDS5ReplicationAgreement nsDS5ReplicaCredentials: password nsDS5ReplicaTransportInfo: LDAPimport:
sh ldif2ldap -D "Directory Manager" secret /tmp/4_replica_agreement.ldif5. run the replication, save as /tmp/5_replica_run.ldif
dn: cn=XX202-XX202toXX016, cn=replica,cn="dc=kura1, dc=com", cn=mapping tree,cn=config changetype: modify add: nsds5BeginReplicaRefresh nsds5BeginReplicaRefresh: startimport:
sh ldif2ldap -D "Directory Manager" secret /tmp/5_replica_run.ldifFor second server do same step, the differences only at step 2,3,4,5 like this. 2. create changelog dir, save as 2_2_change_log.ldif
dn: cn=changelog5,cn=config objectclass: top objectclass: extensibleObject cn: changelog5 nsslapd-changelogdir: /var/lib/dirsrv/slapd-kura2/changelogdb nsslapd-changelogmaxage: 10dimport:
sh ldif2ldap -D "Directory Manager" secret /tmp/2_2_change_log.ldif3. create replica task, save as /tmp/3_2_replica_task.ldif
dn: cn=replica,cn=dc\3Dkura2\, dc\3Dcom,cn=mapping tree,cn=config nsDS5ReplicaType: 3 cn: replica nsDS5ReplicaBindDN: cn=replication manager,cn=config nsds5ReplicaPurgeDelay: 604800 nsDS5ReplicaRoot: dc=kura2, dc=com nsDS5ReplicaId: 8 objectClass: extensibleObject objectClass: top objectClass: nsDS5Replica nsds5ReplicaChangeCount: 1 nsDS5Flags: 1import:
sh ldif2ldap -D "Directory Manager" secret /tmp/3_2_replica_task.ldif4. create replica agreement from 16 to 202, save as /tmp/4_2_replica_agreement.ldif
dn: cn=XX016-XX016toXX202,cn=replica,cn=dc\3Dkura2\, dc\3Dcom,cn=mapping tree,cn=config cn: XX016-XX016toXX202 nsDS5ReplicaBindDN: cn=replication manager,cn=config description: from XX016 to XX202 nsDS5ReplicaRoot: dc=kura2, dc=com nsDS5ReplicaHost: kura1.com nsDS5ReplicaPort: 389 nsDS5ReplicaBindMethod: SIMPLE objectClass: top objectClass: nsDS5ReplicationAgreement nsDS5ReplicaCredentials: password nsDS5ReplicaTransportInfo: LDAPimport:
sh ldif2ldap -D "Directory Manager" secret /tmp/4_2_replica_agreement.ldif5. run the replication, save as /tmp/5_2_replica_run.ldif
dn: cn=XX016-XX016toXX202, cn=replica,cn="dc=kura2, dc=com", cn=mapping tree,cn=config changetype: modify add: nsds5BeginReplicaRefresh nsds5BeginReplicaRefresh: startimport:
sh ldif2ldap -D "Directory Manager" secret /tmp/5_2_replica_run.ldif
Comments
Post a Comment