~aw/usbs-directory/trunk

« back to all changes in this revision

Viewing changes to doc/guide/admin/replication.sdf

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2008-08-11 20:26:05 UTC
  • mto: (0.2.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080811202605-gz5k22gasx0gsbp4
Tags: upstream-2.4.11
ImportĀ upstreamĀ versionĀ 2.4.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $OpenLDAP: pkg/openldap-guide/admin/replication.sdf,v 1.32.2.15 2008/04/21 17:10:13 quanah Exp $
 
1
# $OpenLDAP: pkg/openldap-guide/admin/replication.sdf,v 1.32.2.16 2008/07/10 00:58:19 quanah Exp $
2
2
# Copyright 1999-2008 The OpenLDAP Foundation, All Rights Reserved.
3
3
# COPYING RESTRICTIONS APPLY, see COPYRIGHT.
4
4
 
49
49
The easiest way is to point an LDAP backend ({{SECT: Backends}} and {{slapd-ldap(8)}}) 
50
50
to your slave directory and setup Syncrepl to point to your Master database.
51
51
 
52
 
REFERENCE test045/048 for better explanation of above.
53
 
 
54
52
If you imagine Syncrepl pulling down changes from the Master server, and then
55
53
pushing those changes out to your slave servers via {{slapd-ldap(8)}}. This is 
56
 
called proxy mode (elaborate/confirm?).
57
 
 
58
 
DIAGRAM HERE
59
 
 
60
 
BETTER EXAMPLE here from test045/048 for different push/multiproxy examples.
61
 
 
62
 
Here's an example:
63
 
 
64
 
 
65
 
>       include         ./schema/core.schema
66
 
>       include         ./schema/cosine.schema
67
 
>       include         ./schema/inetorgperson.schema
68
 
>       include         ./schema/openldap.schema
69
 
>       include         ./schema/nis.schema
70
 
>       
71
 
>       pidfile         /home/ghenry/openldap/ldap/tests/testrun/slapd.3.pid
72
 
>       argsfile        /home/ghenry/openldap/ldap/tests/testrun/slapd.3.args
73
 
>       
74
 
>       modulepath      ../servers/slapd/back-bdb/
75
 
>       moduleload      back_bdb.la
76
 
>       modulepath  ../servers/slapd/back-monitor/
77
 
>       moduleload  back_monitor.la
78
 
>       modulepath  ../servers/slapd/overlays/
79
 
>       moduleload  syncprov.la
80
 
>       modulepath  ../servers/slapd/back-ldap/
81
 
>       moduleload  back_ldap.la
82
 
>       
83
 
>       # We don't need any access to this DSA
84
 
>       restrict        all
85
 
>       
86
 
>       #######################################################################
87
 
>       # consumer proxy database definitions
88
 
>       #######################################################################
89
 
>       
90
 
>       database        ldap
91
 
>       suffix          "dc=example,dc=com"
92
 
>       rootdn          "cn=Whoever"
93
 
>       uri             ldap://localhost:9012/
94
 
>       
95
 
>       lastmod         on
96
 
>       
97
 
>       # HACK: use the RootDN of the monitor database as UpdateDN so ACLs apply
98
 
>       # without the need to write the UpdateDN before starting replication
99
 
>       acl-bind        bindmethod=simple
100
 
>                       binddn="cn=Monitor"
101
 
>                       credentials=monitor
102
 
>       
103
 
>       # HACK: use the RootDN of the monitor database as UpdateDN so ACLs apply
104
 
>       # without the need to write the UpdateDN before starting replication
105
 
>       syncrepl        rid=1
106
 
>                       provider=ldap://localhost:9011/
107
 
>                       binddn="cn=Manager,dc=example,dc=com"
108
 
>                       bindmethod=simple
109
 
>                       credentials=secret
110
 
>                       searchbase="dc=example,dc=com"
111
 
>                       filter="(objectClass=*)"
112
 
>                       attrs="*,structuralObjectClass,entryUUID,entryCSN,creatorsName,createTimestamp,modifiersName,modifyTimestamp"
113
 
>                       schemachecking=off
114
 
>                       scope=sub
115
 
>                       type=refreshAndPersist
116
 
>                       retry="5 5 300 5"
117
 
>       
118
 
>       overlay         syncprov
119
 
>       
120
 
>       database        monitor
121
 
 
122
 
DETAILED EXPLANATION OF ABOVE LIKE IN OTHER SECTIONS (line numbers?)
123
 
 
124
 
 
125
 
ANOTHER DIAGRAM HERE
 
54
called Syncrepl Proxy Mode. You can also use Syncrepl Multi-proxy mode:
 
55
 
 
56
!import "push-based-complete.png"; align="center"; title="Syncrepl Proxy Mode"
 
57
FT[align="Center"] Figure X.Y: Replacing slurpd
 
58
 
 
59
The following example is for a self-contained push-based replication solution:
 
60
 
 
61
>       #######################################################################
 
62
>       # Standard OpenLDAP Master/Provider
 
63
>       #######################################################################
 
64
>       
 
65
>       include     /usr/local/etc/openldap/schema/core.schema
 
66
>       include     /usr/local/etc/openldap/schema/cosine.schema
 
67
>       include     /usr/local/etc/openldap/schema/nis.schema
 
68
>       include     /usr/local/etc/openldap/schema/inetorgperson.schema
 
69
>       
 
70
>       include     /usr/local/etc/openldap/slapd.acl
 
71
>       
 
72
>       modulepath  /usr/local/libexec/openldap
 
73
>       moduleload  back_hdb.la
 
74
>       moduleload  syncprov.la
 
75
>       moduleload  back_monitor.la
 
76
>       moduleload  back_ldap.la
 
77
>       
 
78
>       pidfile     /usr/local/var/slapd.pid
 
79
>       argsfile    /usr/local/var/slapd.args
 
80
>       
 
81
>       loglevel    sync stats
 
82
>       
 
83
>       database    hdb
 
84
>       suffix      "dc=suretecsystems,dc=com"
 
85
>       directory   /usr/local/var/openldap-data
 
86
>       
 
87
>       checkpoint      1024 5
 
88
>       cachesize       10000
 
89
>       idlcachesize    10000
 
90
>       
 
91
>       index       objectClass eq
 
92
>       # rest of indexes
 
93
>       index       default     sub
 
94
>       
 
95
>       rootdn          "cn=admin,dc=suretecsystems,dc=com"
 
96
>       rootpw          testing 
 
97
>       
 
98
>       # syncprov specific indexing
 
99
>       index entryCSN eq
 
100
>       index entryUUID eq
 
101
>       
 
102
>       # syncrepl Provider for primary db
 
103
>       overlay syncprov
 
104
>       syncprov-checkpoint 1000 60
 
105
>       
 
106
>       # Let the replica DN have limitless searches
 
107
>       limits dn.exact="cn=replicator,dc=suretecsystems,dc=com" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited
 
108
>       
 
109
>       database    monitor
 
110
>       
 
111
>       database    config
 
112
>       rootpw          testing
 
113
>       
 
114
>       ##############################################################################
 
115
>       # Consumer Proxy that pulls in data via Syncrepl and pushes out via slapd-ldap
 
116
>       ##############################################################################
 
117
>       
 
118
>       database        ldap
 
119
>       # ignore conflicts with other databases, as we need to push out to same suffix
 
120
>       hidden              on
 
121
>       suffix          "dc=suretecsystems,dc=com"
 
122
>       rootdn          "cn=slapd-ldap"
 
123
>       uri             ldap://localhost:9012/
 
124
>       
 
125
>       lastmod         on
 
126
>               
 
127
>       # We don't need any access to this DSA
 
128
>       restrict        all
 
129
>       
 
130
>       acl-bind        bindmethod=simple
 
131
>                       binddn="cn=replicator,dc=suretecsystems,dc=com"
 
132
>                       credentials=testing
 
133
>       
 
134
>       syncrepl        rid=001
 
135
>                       provider=ldap://localhost:9011/
 
136
>                       binddn="cn=replicator,dc=suretecsystems,dc=com"
 
137
>                       bindmethod=simple
 
138
>                       credentials=testing
 
139
>                       searchbase="dc=suretecsystems,dc=com"
 
140
>                       type=refreshAndPersist
 
141
>                       retry="5 5 300 5"
 
142
>       
 
143
>       overlay         syncprov
 
144
 
 
145
A replica configuration for this type of setup could be:
 
146
 
 
147
>       #######################################################################
 
148
>       # Standard OpenLDAP Slave without Syncrepl
 
149
>       #######################################################################
 
150
>       
 
151
>       include     /usr/local/etc/openldap/schema/core.schema
 
152
>       include     /usr/local/etc/openldap/schema/cosine.schema
 
153
>       include     /usr/local/etc/openldap/schema/nis.schema
 
154
>       include     /usr/local/etc/openldap/schema/inetorgperson.schema
 
155
>       
 
156
>       include     /usr/local/etc/openldap/slapd.acl
 
157
>       
 
158
>       modulepath  /usr/local/libexec/openldap
 
159
>       moduleload  back_hdb.la
 
160
>       moduleload  syncprov.la
 
161
>       moduleload  back_monitor.la
 
162
>       moduleload  back_ldap.la
 
163
>       
 
164
>       pidfile     /usr/local/var/slapd.pid
 
165
>       argsfile    /usr/local/var/slapd.args
 
166
>       
 
167
>       loglevel    sync stats
 
168
>       
 
169
>       database    hdb
 
170
>       suffix      "dc=suretecsystems,dc=com"
 
171
>       directory   /usr/local/var/openldap-slave/data
 
172
>       
 
173
>       checkpoint      1024 5
 
174
>       cachesize       10000
 
175
>       idlcachesize    10000
 
176
>       
 
177
>       index       objectClass eq
 
178
>       # rest of indexes
 
179
>       index       default     sub
 
180
>       
 
181
>       rootdn          "cn=admin,dc=suretecsystems,dc=com"
 
182
>       rootpw          testing 
 
183
>       
 
184
>       # Let the replica DN have limitless searches
 
185
>       limits dn.exact="cn=replicator,dc=suretecsystems,dc=com" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited
 
186
>       
 
187
>       updatedn "cn=replicator,dc=suretecsystems,dc=com"
 
188
>       
 
189
>       # Refer updates to the master
 
190
>       updateref   ldap://localhost:9011
 
191
>       
 
192
>       database    monitor
 
193
>       
 
194
>       database    config
 
195
>       rootpw          testing
 
196
 
 
197
You can see we use the {{updatedn}} directive here and example ACLs ({{F:usr/local/etc/openldap/slapd.acl}}) for this could be:
 
198
        
 
199
>       # Give the replica DN unlimited read access.  This ACL may need to be
 
200
>       # merged with other ACL statements.
 
201
>       
 
202
>       access to *
 
203
>            by dn.base="cn=replicator,dc=suretecsystems,dc=com" write
 
204
>            by * break
 
205
>       
 
206
>       access to dn.base=""
 
207
>               by * read
 
208
>       
 
209
>       access to dn.base="cn=Subschema"
 
210
>               by * read
 
211
>       
 
212
>       access to dn.subtree="cn=Monitor"
 
213
>           by dn.exact="uid=admin,dc=suretecsystems,dc=com" write
 
214
>           by users read
 
215
>           by * none
 
216
>       
 
217
>       access to *
 
218
>               by self write
 
219
>               by * read 
 
220
 
 
221
In order to support more replicas, just add more {{database ldap}} sections and
 
222
increment the {{syncrepl rid}} number accordingly.
 
223
 
 
224
Note: You must populate the Master and Slave directories with the same data, 
 
225
unlike when using normal Syncrepl
 
226
 
 
227
If you do not have access to modify the master directory configuration you can
 
228
configure a standalone ldap proxy, which might look like:
 
229
 
 
230
!import "push-based-standalone.png"; align="center"; title="Syncrepl Standalone Proxy Mode"
 
231
FT[align="Center"] Figure X.Y: Replacing slurpd with a standalone version
 
232
 
 
233
The following configuration is an example of a standalone LDAP Proxy:
 
234
 
 
235
>       include     /usr/local/etc/openldap/schema/core.schema
 
236
>       include     /usr/local/etc/openldap/schema/cosine.schema
 
237
>       include     /usr/local/etc/openldap/schema/nis.schema
 
238
>       include     /usr/local/etc/openldap/schema/inetorgperson.schema
 
239
>       
 
240
>       include     /usr/local/etc/openldap/slapd.acl
 
241
>       
 
242
>       modulepath  /usr/local/libexec/openldap
 
243
>       moduleload  syncprov.la
 
244
>       moduleload  back_ldap.la
 
245
>       
 
246
>       ##############################################################################
 
247
>       # Consumer Proxy that pulls in data via Syncrepl and pushes out via slapd-ldap
 
248
>       ##############################################################################
 
249
>       
 
250
>       database        ldap
 
251
>       # ignore conflicts with other databases, as we need to push out to same suffix
 
252
>       hidden              on
 
253
>       suffix          "dc=suretecsystems,dc=com"
 
254
>       rootdn          "cn=slapd-ldap"
 
255
>       uri             ldap://localhost:9012/
 
256
>       
 
257
>       lastmod         on
 
258
>               
 
259
>       # We don't need any access to this DSA
 
260
>       restrict        all
 
261
>       
 
262
>       acl-bind        bindmethod=simple
 
263
>                       binddn="cn=replicator,dc=suretecsystems,dc=com"
 
264
>                       credentials=testing
 
265
>       
 
266
>       syncrepl        rid=001
 
267
>                       provider=ldap://localhost:9011/
 
268
>                       binddn="cn=replicator,dc=suretecsystems,dc=com"
 
269
>                       bindmethod=simple
 
270
>                       credentials=testing
 
271
>                       searchbase="dc=suretecsystems,dc=com"
 
272
>                       type=refreshAndPersist
 
273
>                       retry="5 5 300 5"
 
274
>       
 
275
>       overlay         syncprov
126
276
 
127
277
As you can see, you can let your imagination go wild using Syncrepl and 
128
278
{{slapd-ldap(8)}} tailoring your replication to fit your specific network