使用 ejabberd 时出现间歇性登录问题(LDAP 超时?)

使用 ejabberd 时出现间歇性登录问题(LDAP 超时?)

我们在 Ubuntu 17.10 VM 上运行 ejabberd 17.07,并针对 Windows Server 2012 R2 上的 Active Directory 进行身份验证。

大多可以正常工作,但每天登录都会失败几次。看来 ejabberd 在尝试从 LDAP 服务器查找信息时超时了。重新启动守护进程,如下所示:

sudo ejabberdctl restart

...显然将所有人都踢出去了,但之后,登录立即就可以再次正常了。

我在 Windows 端没有看到任何相关日志(我查看了安全和目录服务日志),这表明实际上没有尝试进行身份验证。然而,在 ejabberd 端,有时会出现这样的日志:

2018-04-30 13:08:05.560 [error] <0.587.0>@eldap_pool:do_request:75 LDAP request failed: timed out

重新启动服务器时,会出现以下情况:

2018-04-30 14:58:35.524 [error] <0.793.0>@eldap_pool:do_request:77 LDAP request failed: eldap:search([[{base,<<"ou=Mitarbeiter,dc=…,dc=local">>},{filter,{and,[{equalityMatch,{'AttributeValueAssertion',<<"objectCategory">>,<<"group">>}},{equalityMatch,{'AttributeValueAssertion',<<"cn">>,<<"Alle Mitarbeiter">>}}]}},{timeout,5},{deref_aliases,never},{attributes,[<<"sAMAccountName">>]}]])
Reason: {shutdown,{gen_fsm,sync_send_event,[<0.462.0>,{search,{eldap_search,wholeSubtree,<<"ou=Mitarbeiter,dc=trenz,dc=local">>,{and,[{equalityMatch,{'AttributeValueAssertion',<<"objectCategory">>,<<"group">>}},{equalityMatch,{'AttributeValueAssertion',<<"cn">>,<<"Alle Mitarbeiter">>}}]},0,[<<"sAMAccountName">>],false,neverDerefAliases,5}},110500]}}

注意“原因:关闭”部分。

粗略搜索表明这与 TCP keepalive 设置有关,即:ejabberd 似乎希望 LDAP 连接保持打开状态,而 Active Directory(默默地)希望请求是单个事务。我对此的理解大致正确吗?

如果是这样,那么只需按照建议修补 ejabberd 二进制文件即可这里在其他地方我该怎么办?

(我也尝试过调整 Linux 机器上的 keepalive 设置,但没有成功。)

相关内容