我需要build立一个本地LDAP代理caching,连接到我们的中央Active Directory服务器。 OpenLDAP代理caching看起来就像这样。 但是尽可能接近手册页,我无法得到它的工作。
我能够通过本地主机代理请求到远程服务器,但他们没有caching(或caching不检索,至less)。
我所做的步骤:
openldap-servers
和openldap-clients
软件包 slapd.conf
configuration文件(详情如下) slapd -d -1
命令启动服务器 ldapwhoami -vvv -h localhost -D "CN=Melka Martin,OU=(...),DC=int,DC=ourdomain,DC=com" -x -w <password>
服务器: ldapwhoami -vvv -h localhost -D "CN=Melka Martin,OU=(...),DC=int,DC=ourdomain,DC=com" -x -w <password>
结果是成功。 但嗅探networkingstream量显示查询是从中央LDAP服务器汇集。
slapd
输出相当详细,但它在一个点的状态
QUERY NOT ANSWERABLE QUERY CACHEABLE
唉,如果它得到caching,它永远不会回答。 任何想法可能是错的?
"cn=admin,dc=int,dc=ourdomain,dc=com"
是远程LDAP服务器中的admin用户的DN。 他的密码是<something>
。
slapd.conf中
database ldap suffix "dc=int,dc=ourdomain,dc=com" rootdn "cn=admin,dc=int,dc=ourdomain,dc=com" rootpw <something> uri ldap://dc-04.int.ourdomain.com:389 overlay pcache pcache hdb 100000 1 1000 100 pcacheAttrset 0 * pcacheTemplate (sn=) 0 3600 pcacheBind (sn=) 0 3600 sub dc=int,dc=ourdomain,dc=com cachesize 200 directory /var/lib/ldap index objectClass eq index cn eq,sub
DB_CONFIG
# $OpenLDAP$ # one 0.25 GB cache set_cachesize 0 268435456 1 # Transaction Log settings set_lg_regionmax 262144 set_lg_bsize 2097152
详细的日志输出: http : //pastebin.com/9s8HMg7d
您是否希望caching以下查询?
ldapwhoami -vvv -h localhost -D "CN=Melka Martin,OU=(...),DC=int,DC=ourdomain,DC=com" -x -w <password>
首先我会改变模板来匹配auth参数:
pcacheTemplate (dn=) 0 3600 pcacheBind (dn=) 0 3600 sub dc=int,dc=ourdomain,dc=com
(dn是专名,sn是姓氏)
但是,如果它工作,我会感到惊讶。 事实上,我不确定ldapwhoami
是testing这个覆盖的正确工具。 手册页介绍authentication clients
,例如nss_ldap
。 你应该事先configuration它,并观察它执行的查询,所以你可以模仿模板,范围和基地。
有几件事情可能会有所帮助或有助于缩小根本原因。 。 。
我想指出,我注意到你正在运行slapd -d -1
,这意味着运行slapd
与debugging和日志级别1
意味着verbose
/ enable all debugging
。
从我在下面的post URL资源中读到的,如果你没有在slapd -f <filename>
语法中运行并且完全限定<filename>
指向一个“alternative” slapd.config
文件,那么。 。 。 “ 默认通常是/usr/local/etc/openldap/slapd.conf”。
因此,这可能不会真正运行slapd
并将其指向configuration文件以获取您在替代configuration文件中放置的指针/参数,因此如果这是问题,请先尝试一下。
可能与这个错误有关( ERROR PART1
): 564da523 config_back_db_open: No explicit ACL for back-config configured. Using hardcoded default
564da523 config_back_db_open: No explicit ACL for back-config configured. Using hardcoded default
(资源: http : //www.openldap.org/doc/admin24/runningslapd.html )
注: 我在你提供的详细日志中看到一些数据库相关的错误消息,所以也许它找不到适用的数据库,除非你改变到该目录,所以它可以隐式查找,除非如果支持其他显式数据库指针方法(注2可能适用于这个方法)。
注2: 这里有一个很好的阅读LDAP代理方法,并在configuration中使用uri
等,这样只是为了检查在slapd.conf
文件( http://www.openldap)中可能丢失或错误configuration的东西。 org / faq / data / cache / 532.html ) 。
Note2节资源中的一些有趣点
LDAP Proxy
binddn
bindpw
identity assertion
identity assertion configuration
首先,看起来你有两个版本的OpenLADAP,所以在这里可能需要阅读发行注记,看看是否有什么东西可以应用于你的问题( http://www.openldap.org/software/release/changes.html )如果可能的话,可能需要升级或从testing升级系统运行。
其次,详细的日志详细信息提供了更多的错误信息等等,我想特别指出下面的ERROR PART 1
, ERROR PART 2
, ERROR PART 3
和ERROR PART 4
。
(资源: http : //www.openldap.org/doc/admin24/appendix-common-errors.html )
从我所读到的内容来看,如果你觉得所有的configuration都是正确的,那么ERROR PART 1
第一ERROR PART 1
第一行确实可能只是一个“警告”,是安全的。
然而,下面的行( ~Using hardcoded default
)可能是上面第一部分的部分,因为我列出了URL等。
错误的第一部分
564da523 config_back_db_open: line 0: warning: cannot assess the validity of the ACL scope within backend naming context 564da523 config_back_db_open: No explicit ACL for back-config configured. Using hardcoded default
资源:
错误的第二部分
564da523 <= hdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988) 564da523 <= hdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
在这个(上面)中,我在这里find了一个slapd.conf
文件的例子,其中一个(下面)说明了这一点,所以我想知道是不是像你需要更改到你的案例中的slapd.conf
文件中的DB目录一样简单。
(资源: http : //www.zytrax.com/books/ldap/ch5 )
来自资源URL的示例
# root or superuser rootdn "cn=jimbob, dc=example, dc=com" rootpw dirtysecret # The database directory MUST exist prior to running slapd AND # change path as necessary directory /var/db/openldap/example-com
错误的部分3
通过使用telnet <host> <port>
排除LDAP IP地址故障
也可能有用( http://www.openldap.org/faq/data/cache/532.html )
ldap_read: want=8 error=Resource temporarily unavailable
错误部分4
64da525 <= hdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988) 564da525 => bdb_entry_get: cannot find entry: "cn=melka martin,ou=release engineering,ou=development,ou=research and development,ou=cz,dc=int,dc=company,dc=com" 564da525 QUERY NOT ANSWERABLE 564da525 QUERY CACHEABLE