This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
docpublic:systemes:ldap:ldapc8reppartiel [2020/02/11 21:19] procacci@tem-tsp.eu created |
docpublic:systemes:ldap:ldapc8reppartiel [2020/02/15 07:46] (current) procacci@tem-tsp.eu [acl] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== replica ==== | ||
| + | |||
| + | === ref === | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| ===== package ltb-project ===== | ===== package ltb-project ===== | ||
| Line 21: | Line 32: | ||
| chown -R ldap:ldap / | chown -R ldap:ldap / | ||
| systemctl start slapd | systemctl start slapd | ||
| + | </ | ||
| + | |||
| + | ===== ACL ldap master ==== | ||
| + | |||
| + | sur le master ldap il faut disposer d'un compte de replication qui a le droit en lecture sur toutes les arborecences et attributs necessaires a notre replica | ||
| + | |||
| + | notament sur l' | ||
| + | |||
| + | < | ||
| + | #JP acl | ||
| + | # continue pour que repint puisse lire dans la replication son propre pass et pas seulement faire du auth | ||
| + | # cf https:// | ||
| + | # finalement pas utile car pour etre self il faut d' | ||
| + | access to attrs=userPassword | ||
| + | by self auth continue | ||
| + | by anonymous | ||
| + | by dn=" | ||
| + | by * none | ||
| + | | ||
| + | #Voir le root DSE + base DN , cf http:// | ||
| + | access to dn.subtree=" | ||
| + | by dn=" | ||
| + | by * read | ||
| + | ... | ||
| + | | ||
| </ | </ | ||
| Line 84: | Line 120: | ||
| </ | </ | ||
| + | |||
| + | ==== acl === | ||
| + | |||
| + | sur ce replica partiel (pages blanches) , ACL assez simples | ||
| + | |||
| + | < | ||
| + | [root@ldapex openldap]# cat slapd.acl.conf | ||
| + | # attribut userpassword, | ||
| + | access to attrs=userPassword | ||
| + | by anonymous | ||
| + | by dn=" | ||
| + | by * none | ||
| + | |||
| + | #Voir le root DSE + base DN , cf http:// | ||
| + | access to dn.subtree=" | ||
| + | by dn.exact=" | ||
| + | by users read | ||
| + | by anonymous none | ||
| + | by * none | ||
| + | |||
| + | access to * | ||
| + | by dn.exact=" | ||
| + | by self read | ||
| + | by dn=" | ||
| + | by * none | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== syncrepl partiel ===== | ||
| + | |||
| + | enfin la configuration de replication partielle a base de syncrepl , on ne replique que la branche ou=people et seulement certains attributs "pages blanches" | ||
| + | |||
| + | < | ||
| + | [root@ldapex openldap]# cat slapd.sync.conf | ||
| + | syncrepl rid=001 | ||
| + | provider=ldaps:// | ||
| + | type=refreshAndPersist | ||
| + | searchbase=" | ||
| + | filter=" | ||
| + | attrs=" | ||
| + | scope=sub | ||
| + | schemachecking=off | ||
| + | bindmethod=simple | ||
| + | retry=" | ||
| + | keepalive=" | ||
| + | binddn=" | ||
| + | credentials=" | ||
| + | updateref | ||
| + | </ | ||
| + | |||
| + | la liste des parametres syncrepl est dans le man slapd.conf | ||
| + | |||
| + | < | ||
| + | https:// | ||
| + | | ||
| + | syncrepl rid=< | ||
| + | [interval=dd: | ||
| + | [attrs=< | ||
| + | [timeout=< | ||
| + | [credentials=< | ||
| + | [tls_cert=< | ||
| + | [tls_ciphersuite=< | ||
| + | [syncdata=default|accesslog|changelog] | ||
| + | </ | ||
| + | |||
| + | ===== rebuild script ===== | ||
| + | Script qui permet de reconstruire completement le replica partiel , en 2 temps: | ||
| + | - avec injection de l' | ||
| + | - puis relance avec syncrepl pour recuperer toutes les entrées ou=people depuis le master . | ||
| + | |||
| + | |||
| + | < | ||
| + | [root@ldapex openldap]# cat RebuildAllRep.sh | ||
| + | ## 1st pass from delete all current database and init a fresh one | ||
| + | #stop slapd service | ||
| + | systemctl stop slapd | ||
| + | #delete all databases | ||
| + | rm -f / | ||
| + | #delete all OLC config | ||
| + | cd / | ||
| + | rm -rf * | ||
| + | cd .. | ||
| + | #rebuild slpad.d OLC config from slapd-nosync.conf (copy of slapd.conf but without syncrep config) | ||
| + | #because of updateref incompatibility | ||
| + | / | ||
| + | #reset ldap acces to subtree slapd.d | ||
| + | chown -R ldap:ldap / | ||
| + | #reset ldap acces to subtree databases directory | ||
| + | chown -R ldap:ldap / | ||
| + | #restart slapd service | ||
| + | systemctl start slapd | ||
| + | #insert root tree and local dsa account from ldif with ldapi (local soket connect) | ||
| + | / | ||
| + | #pause 1s with sleep 1 | ||
| + | sleep 1 | ||
| + | ################################################################################### | ||
| + | ## 2nd pass to introduce syncrepl and build all sync data from master | ||
| + | #stop slapd service again this time to reload config with syncrepl enabled | ||
| + | systemctl stop slapd | ||
| + | #delete all OLC config | ||
| + | cd / | ||
| + | rm -rf * | ||
| + | cd .. | ||
| + | #rebuild slpad.d OLC config from slapd.conf (containing the syncrepl included) | ||
| + | / | ||
| + | #reset ldap acces to subtree slapd.d | ||
| + | chown -R ldap:ldap / | ||
| + | #reset ldap acces to subtree databases directory | ||
| + | chown -R ldap:ldap / | ||
| + | #restart slapd service | ||
| + | systemctl start slapd | ||
| + | </ | ||