This is an old revision of the document!


import ldif total

importation de toute la base

[root@ldapmaster schema]# time slapadd -f /etc/openldap/slapd.conf -l /usr/local/ldapbackup2/jour-2014-01-09.ldif
...
added: "uid=testgil,ou=People,dc=int-evry,dc=fr" (0000164d)
*#################### 100.00% eta   none elapsed          01m04s spd   3.2 M/s 
Closing DB...

real	1m5.250s
user	0m28.635s
sys	0m15.655s

Configuration 2.4 dynamique

Depuis openldap 2.4, la configuration est dynamique (dans ldap /etc/openldap/slapd.d).

Idealement il faudrait utiliser completement cette fonctionnalité et ainsi utiliser des commandes ldap pour modifier la configuration dynamique. Pour des raisons “d'anciennes pratiques”, il sera utilisé ici un script qui genere automatiquement la configuration dynamqiue

script conversion dynamique

configuration traditionnelle à base de slapd.conf et generation dans slapd.d de la configuration dynamique attendue par openldap 2.4

script

script maison “olcgene.sh” qui genre le slapd.d a partir du slapd.conf

[root@ldapmaster openldap]# cat olcgene.sh 
/etc/init.d/slapd stop
cd /etc/openldap/slapd.d
rm -rf *
cd ..
/usr/sbin/slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
chown -R ldap:ldap /etc/openldap/slapd.d
chown -R ldap:ldap /var/lib/ldap
/etc/init.d/slapd start

au premier lancement j'ai eu ce genre d'erreur

[root@ldapmaster openldap]# /usr/sbin/slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
config_build_attrs: error 21 on olcAttributeTypes value #25
config_build_entry: build "cn={17}int-evry" failed: ""
backend_startup_one (type=config, suffix="cn=config"): bi_db_open failed! (-1)
slap_startup failed (test would succeed using the -u switch)

apres lecture de http://opennomad.com/content/openldap-and-magic-latin-1-versus-unicode-schema on s'apperçoit c'est un probleme d'encodage des fichiers schema

conversion iconv UTF8 des schemas

conversion en utf8

[root@ldapmaster schema]# for x in *.schema; do iconv -f iso-8859-1 -t utf-8 ${x} > ${x}.new; done

affichage des differences (reparrage des fichiers qui pose pb)

[root@ldapmaster schema]# for x in *.schema; do echo ${x}; diff ${x} ${x}.new; done
int-evry.schema
1c1
< #definitions propres � l'int
---
> #definitions propres à l'int

schac-20090326-1.4.0.schema
243c243
< # Descrip: Specifies a person�s home organization using the domain name 
---
> # Descrip: Specifies a person´s home organization using the domain name 

supann_2009.schema
9c9
< # Plac� sous l'arc 1.3.6.1.4.1.7135.1.2 du CRU
---
> # Placé sous l'arc 1.3.6.1.4.1.7135.1.2 du CRU
...
[root@ldapmaster schema]# mv int-evry.schema.new int-evry.schema
[root@ldapmaster schema]# mv schac-20090326-1.4.0.schema.new schac-20090326-1.4.0.schema
[root@ldapmaster schema]# mv supann_2009.schema.new supann_2009.schema

Cela se passe mieux maitenant

[root@ldapmaster openldap]# ./olcgene.sh 
Stopping slapd:                                            [  OK  ]
bdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap/int: (2).
Expect poor performance for suffix "dc=int-evry,dc=fr".
config file testing succeeded
Starting slapd:                                            [  OK  ]

DB_CONFIG

on notera ci-dessus le message “bdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).”

on va recopier un fichier exemple de DB_CONFIG dans le repertoire de base de notre annuaire et on genere a nouveau la configuration qui cette fois se termine sans warning .

[root@ldapmaster openldap]# cp /root/openldap/DB_CONFIG.example /var/lib/ldap
[root@ldapmaster openldap]# mv /var/lib/ldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
[root@ldapmaster openldap]# chown ldap /var/lib/ldap/DB_CONFIG
[root@ldapmaster openldap]# ./olcgene.sh 
Stopping slapd:                                            [  OK  ]
config file testing succeeded
Starting slapd:                                            [  OK  ]

replication

s'assurer que le size limit du master ne bloque pas la replication

Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1012 op=2 UNBIND
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1012 fd=18 closed
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 fd=18 ACCEPT from IP=157.159.110.247:45775 (IP=0.0.0.0:636)
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 fd=18 TLS established tls_ssf=256 ssf=256
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 op=0 BIND dn="cn=replicator,ou=system,dc=int-evry,dc=fr" method=128
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 op=0 BIND dn="cn=replicator,ou=System,dc=int-evry,dc=fr" mech=SIMPLE ssf=0
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 op=0 RESULT tag=97 err=0 text=
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 op=1 SRCH base="dc=int-evry,dc=fr" scope=2 deref=0 filter="(objectClass=*)"
Jan 10 13:16:02 ldapmaster slapd[17562]: conn=1013 op=1 SRCH attr=* +
Jan 10 13:16:08 ldapmaster slapd[17562]: conn=1013 op=1 SEARCH RESULT tag=101 err=4 nentries=500 text=
Jan 10 13:16:08 ldapmaster slapd[17562]: conn=1013 op=2 UNBIND
Jan 10 13:16:08 ldapmaster slapd[17562]: conn=1013 fd=18 closed

ici le err=4 singal un depassement du size limit

http://www.zytrax.com/books/ldap/ch12/ ⇒ LDAP_SIZELIMIT_EXCEEDED 4 (x'04) An LDAP size limit was exceeded.

SSL

sous centos, penser a valider l'option de demarrage en SSL

[root@ldap1 openldap]# grep LDAPS /etc/sysconfig/ldap
# At least one of SLAPD_LDAP, SLAPD_LDAPI and SLAPD_LDAPS must be set to 'yes'!
SLAPD_LDAPS=yes

references

docpublic/systemes/ldap/ldap2-4.1389369689.txt.gz · Last modified: 2014/01/10 16:01 by procacci@tem-tsp.eu
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0