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

Re: commit: ldap/tests/scripts test049-sync-config defines.sh



hyc@OpenLDAP.org wrote:
Update of /repo/OpenLDAP/pkg/ldap/tests/scripts

Modified Files:
	defines.sh  1.147 -> 1.148
Added Files:
	test049-sync-config  NONE -> 1.1

Log Message:
Test slave bootstrapping via syncrepl

For anyone curious, this test shows how to use back-config and syncrepl to dynamically configure and populate a server.


Two stub entries (cn=config and olcdatabase=config,cn=config) are slapadded to initialize the master and slave configurations. Then ldapadd/ldapmodify are used to load the syncprov module, add a syncrepl consumer to the config database, and add the syncprov overlay to the config database on the master.

Then ldapmodify is used to start a syncrepl consumer on the slave's config database.

The rest of the script adds schema, a database backend and content for the backend on the master, all of which get replicated to the slave.

The dilemma of how not to wipe out the consumer configuration once the complete master configuration is replicated onto it is solved with this trick: the master has both a provider and a consumer configured on it, and the consumer points at the master. The syncrepl config handler checks to see if its providerURI matches any of the current server's listenerURIs. If there's a match, the config is a no-op. (It gets parsed but no consumer task is triggered.)

--
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/