我知道LDAP查询是有限制的,因此我设置了一个没有限制的用户。 但即使如此,我面临着“超出pipe理限制”的错误。
我在下面包含数据库configuration的摘录。 我正在使用用户cn = checkrepl,cn = users,dc = domain,dc = es。
esauro@ubuntu:~$ ldapsearch -x -W -D 'cn=admin,cn=config' -b 'cn=config' -h openldap1 'olcDatabase={1}hdb' Enter LDAP Password: # extended LDIF # # LDAPv3 # base <cn=config> with scope subtree # filter: olcDatabase={1}hdb # requesting: ALL # # {1}hdb, config dn: olcDatabase={1}hdb,cn=config objectClass: olcDatabaseConfig objectClass: olcHdbConfig olcDatabase: {1}hdb olcDbDirectory: /var/lib/ldap olcSuffix: dc=domain,dc=es olcAccess: {0}to attrs=userPassword,shadowLastChange by self write by anonymou s auth by dn="cn=admin,dc=domain,dc=es" write by dn.subtree="cn=Managers,dc=domain, dc=es" read by * none olcAccess: {2}to dn.base="" by * read olcAccess: {3}to * by self write by dn="cn=admin,dc=domain,dc=es" write by * read olcLastMod: TRUE olcLimits: {2}dn="cn=checkrepl,cn=Users,dc=domain,dc=es" time.soft=unlimited time .hard=unlimited size.soft=unlimited size.hard=unlimited olcSizeLimit: size=100000 size.unchecked=100000 olcMirrorMode: TRUE olcMonitoring: TRUE olcDbCacheSize: 200000 olcDbCheckpoint: 512 30 olcDbConfig: {0}set_cachesize 0 536870912 0 olcDbConfig: {1}set_lk_max_objects 1500 olcDbConfig: {2}set_lk_max_locks 1500
然而,每当我查询目录,如果结果很大,我得到的错误,无论我是否包括标志来限制查询的时间和大小。
esauro@ubuntu:~$ ldapsearch -z 40 -l 1000 -x -W -D 'cn=checkrepl,cn=users,dc=domain,dc=es' -b 'dc=domain,dc=es' -h openldap1 'uid=al*' dn Enter LDAP Password: # extended LDIF # # LDAPv3 # base <dc=domain,dc=es> with scope subtree # filter: uid=al* # requesting: dn # # search result search: 2 result: 11 Administrative limit exceeded # numResponses: 1
我使用ldap-utils(版本2.4.23和2.4.28)作为客户端和openldap(2.4.23)作为服务器
编辑:从configuration的另一个摘录包括索引:
olcDbIndex: objectClass eq olcDbIndex: uid eq,pres,sub olcDbIndex: memberUid,uniqueMember eq olcDbIndex: uidNumber,gidNumber eq,pres olcDbIndex: sambaSID,sambaPrimaryGroupSID eq olcDbIndex: sambaGroupType,sambaSIDList eq olcDbIndex: entryCSN,entryUUID eq olcDbIndex: ou,cn eq olcDbIndex: mail,maildrop eq
编辑2:这个确切的configuration(复制和粘贴)使用更新版本的LDAP在另一个LDAP中完美工作。
你有olcDbCacheSize: 200000 (和一个512MBcaching),表明你可能有大量的目录条目。
你有size.unchecked=100000限制查询没有索引的属性。
在你的configuration[extract]中没有olcDbIndex属性,因此可能没有用于search的索引。
如果您有超过10万个条目,则您的search将需要完整的目录扫描,并且超过默认的size.unchecked限制,无论有多less实际匹配uid=al* 。
你真的需要索引。 尝试使用olcLoglevel: stats index运行,并检查您的系统日志configuration,以确保设施(local4是默认设置)有用。 添加索引,包括至less你的通用查询和uid的子(string)索引,并运行slapindex -v进行更新,在生成索引期间不应该运行slapd 。