This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
docpublic:systemes:ldap:ldap_lsc [2015/11/27 18:46] procacci@tem-tsp.eu [yum repo install] |
docpublic:systemes:ldap:ldap_lsc [2015/12/01 15:43] (current) procacci@tem-tsp.eu [suppression] |
||
|---|---|---|---|
| Line 27: | Line 27: | ||
| </ | </ | ||
| - | ==== dependace | + | ==== dependance |
| * https:// | * https:// | ||
| Line 69: | Line 69: | ||
| Terminé ! | Terminé ! | ||
| + | |||
| + | # java -version | ||
| + | java version " | ||
| + | OpenJDK Runtime Environment (rhel-2.6.2.1.el7_1-x86_64 u91-b00) | ||
| + | OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode) | ||
| + | |||
| </ | </ | ||
| + | ===== Scenario ldap to ldap ===== | ||
| + | ref | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | Preparation d'un scenario de synchro de ldap evry vers ldap de fusion mines-telecom | ||
| + | < | ||
| + | [root@lsc lsc]# mkdir / | ||
| + | [root@lsc lsc]# cd / | ||
| + | [root@lsc ldapevry2ldapimt]# | ||
| + | [root@lsc ldapevry2ldapimt]# | ||
| + | [root@lsc ldapevry2ldapimt]# | ||
| + | </ | ||
| + | |||
| + | a suivre [[.: | ||
| + | |||
| + | ==== installation openldap-servers ==== | ||
| + | |||
| + | < | ||
| + | [root@lsc ldap2ldap]# yum install openldap-servers openldap-clients | ||
| + | Installed: | ||
| + | openldap-servers.x86_64 0: | ||
| + | openldap-clients.x86_64 0: | ||
| + | </ | ||
| + | |||
| + | ==== parametrage openldap-server ===== | ||
| + | |||
| + | recuperation de schema propres a nos usages accademiques | ||
| + | < | ||
| + | [root@lsc schema]# cp eduperson-200412.schema supann_2009.schema / | ||
| + | </ | ||
| + | |||
| + | repertoire systeme où sera stocké la base ldap fusion des sources de synchro (initialement backen BDB à passer en lmdb ...) | ||
| + | |||
| + | < | ||
| + | [root@lsc openldap]# vim slapd.conf # directory | ||
| + | [root@lsc openldap]# mkdir / | ||
| + | [root@lsc openldap]# chown ldap:ldap / | ||
| + | |||
| + | [root@lsc openldap]# cp / | ||
| + | [root@lsc openldap]# chown ldap:ldap / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== demarrage du serveur au boot ==== | ||
| + | |||
| + | < | ||
| + | [root@lsc openldap]# systemctl enable slapd.service | ||
| + | ln -s '/ | ||
| + | </ | ||
| + | |||
| + | s' | ||
| + | |||
| + | < | ||
| + | # firewall-cmd --permanent --add-rich-rule 'rule family=" | ||
| + | # firewall-cmd --permanent --add-rich-rule 'rule family=" | ||
| + | # firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | ==== log ldap dans rsyslog ==== | ||
| + | |||
| + | < | ||
| + | [root@lsc openldap]# vim / | ||
| + | [root@lsc openldap]# systemctl restart rsyslog.service | ||
| + | [root@lsc openldap]# grep ldap / | ||
| + | local4.* / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Premier lancement du serveur a vide ==== | ||
| + | |||
| + | < | ||
| + | [root@lsc openldap]# ./ | ||
| + | 565ad68c / | ||
| + | 565ad68c / | ||
| + | 565ad68c bdb_db_open: | ||
| + | 565ad68c backend_startup_one (type=bdb, suffix=" | ||
| + | slap_startup failed (test would succeed using the -u switch) | ||
| + | |||
| + | [root@lsc openldap]# ls -al / | ||
| + | total 19552 | ||
| + | drwxr-xr-x 2 ldap ldap 4096 Nov 29 11:42 . | ||
| + | drwx------ 3 ldap ldap 4096 Nov 29 11:11 .. | ||
| + | -rw-r--r-- 1 ldap ldap 845 Nov 29 11:15 DB_CONFIG | ||
| + | -rw------- 1 ldap ldap 2801664 Nov 29 11:42 __db.001 | ||
| + | -rw------- 1 ldap ldap 17489920 Nov 29 11:42 __db.002 | ||
| + | -rw------- 1 ldap ldap 1884160 Nov 29 11:42 __db.003 | ||
| + | -rw-r--r-- 1 ldap ldap 2048 Nov 29 11:42 alock | ||
| + | -rw------- 1 ldap ldap 8192 Nov 29 11:42 dn2id.bdb | ||
| + | -rw------- 1 ldap ldap 32768 Nov 29 11:42 id2entry.bdb | ||
| + | -rw------- 1 ldap ldap 10485760 Nov 29 11:42 log.0000000001 | ||
| + | |||
| + | [root@lsc openldap]# tail -f / | ||
| + | Nov 29 11:42:20 lscimt slapd[3275]: | ||
| + | mockbuild@worker1.bsys.centos.org:/ | ||
| + | Nov 29 11:42:20 lscimt slapd[3276]: | ||
| + | |||
| + | |||
| + | [root@lsc openldap]# ps auwx |grep slapd | ||
| + | ldap 3276 0.0 2.0 429780 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== ajout de la racine de l' | ||
| + | |||
| + | fichier ldap represantant la racine de l' | ||
| + | < | ||
| + | # cat root-mt.ldif | ||
| + | # mt | ||
| + | dn: dc=mines-telecom, | ||
| + | dc: mines-telecom | ||
| + | objectClass: | ||
| + | objectClass: | ||
| + | objectClass: | ||
| + | associatedDomain: | ||
| + | </ | ||
| + | |||
| + | insertion dans l' | ||
| + | |||
| + | < | ||
| + | [root@lsc ~]# ldapadd -f root-mt.ldif -H ldap:// | ||
| + | adding new entry " | ||
| + | |||
| + | [root@lsc ~]# tail -f / | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | Nov 29 11:51:38 lscimt slapd[3276]: | ||
| + | </ | ||
| + | |||
| + | et de la sous branche people | ||
| + | |||
| + | < | ||
| + | [root@lsc ~]# vim people.ldif | ||
| + | [root@lsc ~]# ldapadd -f people.ldif -H ldap:// | ||
| + | adding new entry " | ||
| + | |||
| + | [root@lsc ~]# cat people.ldif | ||
| + | dn: ou=people, | ||
| + | changetype: add | ||
| + | objectClass: | ||
| + | objectClass: | ||
| + | ou: people | ||
| + | </ | ||
| + | |||
| + | contenu actuel de notre " | ||
| + | |||
| + | < | ||
| + | [root@lsc ~]# ldapsearch -x objectclass=* -H ldap:// | ||
| + | Enter LDAP Password: | ||
| + | dn: dc=mines-telecom, | ||
| + | |||
| + | dn: ou=people, | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Config LSC synchro ldap2ldap ===== | ||
| + | |||
| + | |||
| + | le principe ici est de synchroniser des annuaires ldap vers un annuaire mutualisé assurant la fusion des annuaires d' | ||
| + | |||
| + | Ici , on fait une exclusion des objectclass et attributs non indispensables a un annuaire pages blanches via le < | ||
| + | |||
| + | < | ||
| + | [root@lscimt ldapevry2ldapimt]# | ||
| + | <?xml version=" | ||
| + | <lsc xmlns=" | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== synchro ===== | ||
| + | |||
| + | < | ||
| + | [root@lsc ldapevry2ldapimt]# | ||
| + | 11: | ||
| + | 11: | ||
| + | 11: | ||
| + | 11: | ||
| + | 11: | ||
| + | |||
| + | nov. 30 11:41:14 - INFO - Reflections took 105 ms to scan 1 urls, producing 55 keys and 115 values | ||
| + | nov. 30 11:41:15 - INFO - Logging configuration successfully loaded from / | ||
| + | nov. 30 11:41:15 - INFO - LSC configuration successfully loaded from / | ||
| + | nov. 30 11:41:15 - INFO - Connecting to LDAP server ldap:// | ||
| + | nov. 30 11:41:15 - INFO - Connecting to LDAP server ldap:// | ||
| + | nov. 30 11:41:15 - INFO - Starting sync for user | ||
| + | nov. 30 11:41:15 - INFO - # Adding new object cn=Guy BERNARD, | ||
| + | # Mon Nov 30 11:41:15 CET 2015 | ||
| + | dn: cn=Jacques MARTIN, | ||
| + | changetype: add | ||
| + | employeeType:: | ||
| + | mail: jacques.martin@tem-tsp.eu | ||
| + | sn: MARTIN | ||
| + | departmentNumber: | ||
| + | cn: Jacques MARTIN | ||
| + | telephoneNumber: | ||
| + | objectClass: | ||
| + | objectClass: | ||
| + | objectClass: | ||
| + | objectClass: | ||
| + | givenName: Jacques | ||
| + | |||
| + | nov. 30 11:41:15 - INFO - All entries: 5, to modify entries: 5, successfully modified entries: 5, errors: 0 | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== modification d' | ||
| + | |||
| + | il est possible de modifier à la volée des valeurs d' | ||
| + | |||
| + | Exemple d' | ||
| + | ici si à la source departmentNumber contient MCI alors le transformer en DSI : | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | var department = srcBean.getDatasetFirstValueById(" | ||
| + | if ( department == " | ||
| + | department; | ||
| + | ]]></ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | log associés a cette synchro | ||
| + | |||
| + | < | ||
| + | nov. 30 14:45:17 - INFO - # Updating object cn=Jacques MARTIN, | ||
| + | nov. 30 14:45:17 - INFO - # Updating object cn=Albert MARTIN, | ||
| + | # Mon Nov 30 14:45:17 CET 2015 | ||
| + | dn: cn=Jacques MARTIN, | ||
| + | changetype: modify | ||
| + | replace: departmentNumber | ||
| + | departmentNumber: | ||
| + | - | ||
| + | |||
| + | # Mon Nov 30 14:45:17 CET 2015 | ||
| + | dn: cn=Albert MARTIN, | ||
| + | changetype: modify | ||
| + | replace: departmentNumber | ||
| + | departmentNumber: | ||
| + | - | ||
| + | |||
| + | nov. 30 14:45:17 - INFO - All entries: 5, to modify entries: 2, successfully modified entries: 2, errors: 0 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== suppression ===== | ||
| + | |||
| + | pour supprimer un compte il faut ajouter l' | ||
| + | |||
| + | < | ||
| + | -c,--clean < | ||
| + | tasks or ' | ||
| + | </ | ||
| + | et aussi s' | ||
| + | |||
| + | < | ||
| + | déc. 01 14:29:00 - INFO - Starting sync for user | ||
| + | déc. 01 14:29:00 - ERROR - Empty or non existant source (no IDs found) | ||
| + | </ | ||
| + | |||
| + | voici l' | ||
| + | < | ||
| + | [root@lsc ldap2ldapmintel]# | ||
| + | ... | ||
| + | déc. 01 15:21:52 - INFO - Reflections took 104 ms to scan 1 urls, producing 55 keys and 115 values | ||
| + | déc. 01 15:21:52 - INFO - Logging configuration successfully loaded from / | ||
| + | déc. 01 15:21:52 - INFO - LSC configuration successfully loaded from / | ||
| + | déc. 01 15:21:52 - INFO - Connecting to LDAP server ldap:// | ||
| + | déc. 01 15:21:52 - INFO - Connecting to LDAP server ldap:// | ||
| + | déc. 01 15:21:52 - INFO - Starting sync for user | ||
| + | déc. 01 15:21:52 - ERROR - Empty or non existant source (no IDs found) | ||
| + | déc. 01 15:21:52 - INFO - Starting clean for user | ||
| + | déc. 01 15:21:52 - INFO - # Removing object cn=Jacques MARTIN, | ||
| + | # Tue Dec 01 15:21:52 CET 2015 | ||
| + | dn: cn=Jacques MARTIN, | ||
| + | changetype: delete | ||
| + | |||
| + | déc. 01 15:21:52 - INFO - All entries: 6, to modify entries: 1, successfully modified entries: 1, errors: 0 | ||
| + | </ | ||