具有 mod_authn_alias 的多个 LDAP 服务器:当第一个 LDAP 关闭时故障转移不起作用?

qua*_*nta 6 openldap failover apache-2.2 mod-authn-alias

我一直在尝试使用 Apache 2.2.3 设置冗余 LDAP 服务器。

/etc/httpd/conf.d/authn_alias.conf

<AuthnProviderAlias ldap master>
    AuthLDAPURL ldap://192.168.5.148:389/dc=domain,dc=vn?cn
    AuthLDAPBindDN cn=anonymous,ou=it,dc=domain,dc=vn
    AuthLDAPBindPassword pa$$w0rd
</AuthnProviderAlias>

<AuthnProviderAlias ldap slave>
    AuthLDAPURL ldap://192.168.5.199:389/dc=domain,dc=vn?cn
    AuthLDAPBindDN cn=anonymous,ou=it,dc=domain,dc=vn
    AuthLDAPBindPassword pa$$w0rd
</AuthnProviderAlias>
Run Code Online (Sandbox Code Playgroud)

/etc/httpd/conf.d/authz_ldap.conf

#
# mod_authz_ldap can be used to implement access control and 
# authenticate users against an LDAP database.
# 

LoadModule authz_ldap_module modules/mod_authz_ldap.so

<IfModule mod_authz_ldap.c>
   <Location />
        AuthBasicProvider master slave
        AuthzLDAPAuthoritative Off
        AuthType Basic
        AuthName "Authorization required"

        AuthzLDAPMemberKey member
        AuthUserFile /home/setup/svn/auth-conf
        AuthzLDAPSetGroupAuth user
        require valid-user
        AuthzLDAPLogLevel error
   </Location>
</IfModule>
Run Code Online (Sandbox Code Playgroud)

如果我理解正确,mod_authz_ldap如果第一台服务器关闭或 OpenLDAP 未运行,将尝试在第二个 LDAP 中搜索用户。

但在实践中,它不会发生。通过在主服务器上停止 LDAP 进行测试,在访问 Subversion 存储库时出现“500 内部服务器错误”。该error_log显示:

[11061] auth_ldap authenticate: user quanta authentication failed; URI / [LDAP: ldap_simple_bind_s() failed][Can't contact LDAP server]

我误会了吗?AuthBasicProvider ldap1 ldap2仅表示如果mod_authz_ldap在 ldap1 中找不到用户,它将继续使用 ldap2。它不包括故障转移功能(ldap1 必须运行并且工作正常)?

Chr*_*rin 6

我远非 LDAP 专家,但根据mod_authnz_ldap 文档,您必须像这样在AuthLDAPUrl 指令中指定故障转移 LDAP 服务器

AuthLDAPURL "ldap://ldap1.airius.com ldap2.airius.com/ou=People, o=Airius"
Run Code Online (Sandbox Code Playgroud)

编辑:澄清

您不能为故障转移设置不同的过滤器。故障转移必须是主服务器的镜像才能提供相同的数据。