⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syncrepl.sdf

📁 OpenLdap是LDAP的开源项目
💻 SDF
📖 第 1 页 / 共 2 页
字号:
# $OpenLDAP: pkg/openldap-guide/admin/syncrepl.sdf,v 1.14.2.3 2007/01/02 21:43:43 kurt Exp $# Copyright 2003-2007 The OpenLDAP Foundation, All Rights Reserved.# COPYING RESTRICTIONS APPLY, see COPYRIGHT.H1: LDAP Sync ReplicationThe LDAP Sync replication engine, syncrepl for short, is a consumer-sidereplication engine that enables the consumer LDAP server to maintaina shadow copy of a DIT fragment. A syncrepl engine resides at theconsumer-side as one of the {{slapd}} (8) threads. It creates andmaintains a consumer replica by connecting to the replicationprovider to perform the initial DIT content load followed eitherby periodic content polling or by timely updates upon contentchanges.Syncrepl uses the LDAP Content Synchronization (or LDAP Sync forshort) protocol as the replica synchronization protocol.  It providesa stateful replication which supports both pull-based and push-basedsynchronization and does not mandate the use of a history store.Syncrepl keeps track of the status of the replication content bymaintaining and exchanging synchronization cookies. Because thesyncrepl consumer and provider maintain their content status, theconsumer can poll the provider content to perform incrementalsynchronization by asking for the entries required to make theconsumer replica up-to-date with the provider content. Syncreplalso enables convenient management of replicas by maintaining replicastatus.  The consumer replica can be constructed from a consumer-sideor a provider-side backup at any synchronization status. Syncreplcan automatically resynchronize the consumer replica up-to-datewith the current provider content.Syncrepl supports both pull-based and push-based synchronization.In its basic refreshOnly synchronization mode, the provider usespull-based synchronization where the consumer servers need not betracked and no history information is maintained.  The informationrequired for the provider to process periodic polling requests iscontained in the synchronization cookie of the request itself.  Tooptimize the pull-based synchronization, syncrepl utilizes thepresent phase of the LDAP Sync protocol as well as its delete phase,instead of falling back on frequent full reloads. To further optimizethe pull-based synchronization, the provider can maintain a per-scopesession log as a history store. In its refreshAndPersist mode ofsynchronization, the provider uses a push-based synchronization.The provider keeps track of the consumer servers that have requesteda persistent search and sends them necessary updates as the providerreplication content gets modified.With syncrepl, a consumer server can create a replica withoutchanging the provider's configurations and without restarting theprovider server, if the consumer server has appropriate accessprivileges for the DIT fragment to be replicated. The consumerserver can stop the replication also without the need for provider-sidechanges and restart.Syncrepl supports both partial and sparse replications.  The shadowDIT fragment is defined by a general search criteria consisting ofbase, scope, filter, and attribute list.  The replica content isalso subject to the access privileges of the bind identity of thesyncrepl replication connection.H2: The LDAP Content Synchronization ProtocolThe LDAP Sync protocol allows a client to maintain a synchronizedcopy of a DIT fragment. The LDAP Sync operation is defined as a setof controls and other protocol elements which extend the LDAP searchoperation. This section introduces the LDAP Content Sync protocolonly briefly. For more information, refer to the Internet Draft{{The LDAP Content Synchronization Operation<draft-zeilenga-ldup-sync-05.txt>}}.The LDAP Sync protocol supports both polling and listening forchanges by defining two respective synchronization operations:{{refreshOnly}} and {{refreshAndPersist}}.  Polling is implementedby the {{refreshOnly}} operation.  The client copy is synchronizedto the server copy at the time of polling.  The server finishes thesearch operation by returning {{SearchResultDone}} at the end ofthe search operation as in the normal search.  The listening isimplemented by the {{refreshAndPersist}} operation.  Instead offinishing the search after returning all entries currently matchingthe search criteria, the synchronization search remains persistentin the server. Subsequent updates to the synchronization contentin the server cause additional entry updates to be sent to theclient.The {{refreshOnly}} operation and the refresh stage of the{{refreshAndPersist}} operation can be performed with a presentphase or a delete phase.In the present phase, the server sends the client the entries updatedwithin the search scope since the last synchronization. The serversends all requested attributes, be it changed or not, of the updatedentries.  For each unchanged entry which remains in the scope, theserver sends a present message consisting only of the name of theentry and the synchronization control representing state present.The present message does not contain any attributes of the entry.After the client receives all update and present entries, it canreliably determine the new client copy by adding the entries addedto the server, by replacing the entries modified at the server, andby deleting entries in the client copy which have not been updatednor specified as being present at the server.The transmission of the updated entries in the delete phase is thesame as in the present phase. The server sends all the requestedattributes of the entries updated within the search scope since thelast synchronization to the client. In the delete phase, however,the server sends a delete message for each entry deleted from thesearch scope, instead of sending present messages.  The deletemessage consists only of the name of the entry and the synchronizationcontrol representing state delete.  The new client copy can bedetermined by adding, modifying, and removing entries according tothe synchronization control attached to the {{SearchResultEntry}}message.In the case that the LDAP Sync server maintains a history store andcan determine which entries are scoped out of the client copy sincethe last synchronization time, the server can use the delete phase.If the server does not maintain any history store, cannot determinethe scoped-out entries from the history store, or the history storedoes not cover the outdated synchronization state of the client,the server should use the present phase.  The use of the presentphase is much more efficient than a full content reload in termsof the synchronization traffic.  To reduce the synchronizationtraffic further, the LDAP Sync protocol also provides severaloptimizations such as the transmission of the normalized {{EX:entryUUID}}sand the transmission of multiple {{EX:entryUUIDs}} in a single{{syncIdSet}} message.At the end of the {{refreshOnly}} synchronization, the server sendsa synchronization cookie to the client as a state indicator of theclient copy after the synchronization is completed.  The clientwill present the received cookie when it requests the next incrementalsynchronization to the server.When {{refreshAndPersist}} synchronization is used, the server sendsa synchronization cookie at the end of the refresh stage by sendinga Sync Info message with TRUE refreshDone.  It also sends asynchronization cookie by attaching it to {{SearchResultEntry}}generated in the persist stage of the synchronization search. Duringthe persist stage, the server can also send a Sync Info messagecontaining the synchronization cookie at any time the server wantsto update the client-side state indicator.  The server also updatesa synchronization indicator of the client at the end of the persiststage.In the LDAP Sync protocol, entries are uniquely identified by the{{EX:entryUUID}} attribute value. It can function as a reliableidentifier of the entry. The DN of the entry, on the other hand,can be changed over time and hence cannot be considered as thereliable identifier.  The {{EX:entryUUID}} is attached to each{{SearchResultEntry}} or {{SearchResultReference}} as a part of thesynchronization control.H2: Syncrepl DetailsThe syncrepl engine utilizes both the {{refreshOnly}} and the{{refreshAndPersist}} operations of the LDAP Sync protocol.  If asyncrepl specification is included in a database definition, {{slapd}}(8) launches a syncrepl engine as a {{slapd}} (8) thread and schedulesits execution. If the {{refreshOnly}} operation is specified, thesyncrepl engine will be rescheduled at the interval time after asynchronization operation is completed.  If the {{refreshAndPersist}}operation is specified, the engine will remain active and processthe persistent synchronization messages from the provider.The syncrepl engine utilizes both the present phase and the deletephase of the refresh synchronization. It is possible to configurea per-scope session log in the provider server which stores the{{EX:entryUUID}}s of a finite number of entries deleted from areplication content.  Multiple replicas of single provider contentshare the same per-scope session log. The syncrepl engine uses thedelete phase if the session log is present and the state of theconsumer server is recent enough that no session log entries aretruncated after the last synchronization of the client.  The syncreplengine uses the present phase if no session log is configured forthe replication content or if the consumer replica is too outdatedto be covered by the session log.  The current design of the sessionlog store is memory based, so the information contained in thesession log is not persistent over multiple provider invocations.It is not currently supported to access the session log store byusing LDAP operations. It is also not currently supported to imposeaccess control to the session log.As a further optimization, even in the case the synchronizationsearch is not associated with any session log, no entries will betransmitted to the consumer server when there has been no updatein the replication context.The syncrepl engine, which is a consumer-side replication engine,can work with any backends. The LDAP Sync provider can be configuredas an overlay on any backend, but works best with the {{back-bdb}}or {{back-hdb}} backend. The provider can not support refreshAndPersistmode on {{back-ldbm}} due to limits in that backend's lockingarchitecture.The LDAP Sync provider maintains a {{EX:contextCSN}} for eachdatabase as the current synchronization state indicator of theprovider content.  It is the largest {{EX:entryCSN}} in the providercontext such that no transactions for an entry having smaller{{EX:entryCSN}} value remains outstanding.  The {{EX:contextCSN}}could not just be set to the largest issued {{EX:entryCSN}} because{{EX:entryCSN}} is obtained before a transaction starts and

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -