如何解决RabbitMq:需要帮助来配置身份验证缓存插件“ rabbit_auth_backend_cache”
我试图建立一个新的RabbitMq服务器(版本3.7.23,Erlang版本22.2.3),并且我设法使LDAP身份验证有效。不幸的是,似乎认证速度很慢,因此我的监视工具偶尔会在检查活动性端点时报告错误,并且在浏览最终消失的应用程序时,UI偶尔会显示红色的“无法连接到服务器”错误。 >
在研究我的问题时,似乎rabbit_auth_backend_cache
插件应该对此有所帮助。我实现了缓存,但似乎无法正常工作。 Rabbit日志仍然显示Rabbitmq尝试为每个请求连接到LDAP,并且我没有看到任何错误可以解释高速缓存的情况。
这是我的配置:
[
{kernel,[
]},{rabbitmq_management,[
{listener,[
{port,15672}
]}
]},{rabbit,[
{auth_backends,[rabbit_auth_backend_cache,rabbit_auth_backend_ldap]},{cluster_partition_handling,autoheal},{tcp_listeners,[5672]},{tcp_listen_options,[binary,{packet,raw},{reuseaddr,true},{backlog,128},{nodelay,{exit_on_close,false},{keepalive,{linger,{true,0}}]},{log_levels,[{ connection,info }]},{disk_free_limit,{mem_relative,1.5}},{vm_memory_high_watermark,0.66},{default_user,<<"guest">>},{default_pass,{heartbeat,60}
]},{rabbitmq_auth_backend_ldap,[
...omitted because it contains sensitive data...
] }}
]},{rabbitmq_auth_backend_cache,[{cached_backend,rabbit_auth_backend_ldap},{cache_ttl,5000}]},{rabbit_auth_backend_ldap,[]}
].
以下是我在日志中看到的内容:
在启动过程中:
2020-08-21 15:37:52.239 [info] <0.8.0> Server startup complete; 10 plugins started.
* rabbitmq_auth_backend_ldap
* rabbitmq_shovel_management
* rabbitmq_shovel
* rabbitmq_federation_management
* rabbitmq_top
* rabbitmq_management
* rabbitmq_web_dispatch
* rabbitmq_management_agent
* rabbitmq_federation
* rabbitmq_auth_backend_cache
关机时
2020-08-21 15:37:44.095 [info] <0.43.0> Application cowboy exited with reason: stopped
2020-08-21 15:37:44.095 [info] <0.11984.0> Stopping application 'cowlib'
2020-08-21 15:37:44.095 [info] <0.43.0> Application cowlib exited with reason: stopped
2020-08-21 15:37:44.095 [info] <0.11984.0> Stopping application 'rabbitmq_auth_backend_ldap'
2020-08-21 15:37:44.096 [info] <0.43.0> Application rabbitmq_auth_backend_ldap exited with reason: stopped
2020-08-21 15:37:44.096 [info] <0.11984.0> Stopping application 'rabbitmq_management_agent'
2020-08-21 15:37:44.098 [info] <0.43.0> Application rabbitmq_management_agent exited with reason: stopped
2020-08-21 15:37:44.098 [info] <0.11984.0> Stopping application 'rabbitmq_auth_backend_cache'
2020-08-21 15:37:44.099 [info] <0.43.0> Application rabbitmq_auth_backend_cache exited with reason: stopped
2020-08-21 15:37:44.099 [info] <0.11984.0> Stopping application 'rabbit'
谢谢,
亚历克斯
解决方法
在其他一些论坛上发布后,看来我只需要将TTL设置为5分钟而不是5秒即可。
谢谢, 亚历克斯
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。