nginx - WSO2 API 管理器集群 : Login error to Publisher and Store

标签 nginx wso2-api-manager wso2

我们正在尝试按照 WSO2 文档在集群中配置 WSO2 API Manager 2.1.0。我们有:

  • 两个网关组成的集群
  • 由两个 key 管理器组成的集群
  • 由两个流量管理器组成的集群

作为前端负载均衡器,我们使用 NGINX。除了这方面之外,一切正常:

当我尝试登录发布者或存储时,请求将发送到负载均衡器,负载均衡器将请求重定向到 key 管理器。 KM1的日志是:

INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - '[email protected] [-1234]' logged in at [2018-02-01 15:23:15,102+0100] {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil}

而在另一个日志(KM2)中是:

TID: [-1234] [] [2018-02-01 15:23:15,165] WARN {org.wso2.carbon.server.admin.module.handler.AuthenticationHandler} - Illegal access attempt at [2018-02-01 15:23:15,0165] from IP address xxxxx while trying to authenticate access to service LoggedUserInfoAdmin {org.wso2.carbon.server.admin.module.handler.AuthenticationHandler}

最终的结果是我无法访问商店或发布商。 如果两个 KM 之一停止,则一切正常。 您对我应该如何配置 KM 或 TM 有什么建议吗? 非常感谢

最佳答案

发生这种情况是因为您尚未为 key 管理器启用粘性 session 。

有两个调用发送至 key 管理器,并且这两个调用应重定向至同一个 key 管理器。在您的情况下,请求以循环方式进行负载平衡。因此,第二次调用失败,因为 session 是在另一个节点中创建的。

请引用下面的文章。 https://wso2.com/library/articles/2015/01/wso2-api-manager-deployment-customization-and-troubleshooting-part-02/

https://docs.wso2.com/display/CLUSTER44x/Configuring+NGINX

Why thrift key validation is not recommend in production deployments

Thrift key validation does not work when we have a load balancer fronted key manager. The reason for this is that most load balancers are not capable of routing traffic in a session-aware manner. Therefore, in such cases, it's always recommended to use the WS key validation client. When we use web service clients we need to enable a sticky session at the load balancer level. Moreover, we need to give a session cookie that we've used to handle session stickiness.

关于nginx - WSO2 API 管理器集群 : Login error to Publisher and Store,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48565086/

相关文章:

WSO2:Greg 和 ESB 存在共享注册表问题

用户自己的 Java API 的 WSO2 Api Manager 示例代码

node.js - Nginx 为 WebSockets 处理 SSL

php - 如何检测 PHP pfsockopen 被远程服务器关闭?

java - 无法使用 "bin/ballerina run service services.bsz"从 wso2apim-gateway-3.0.0 根目录启动网关

WSO2 APIM 2.0 集群部署与流量管理器问题

c# - 关于使用 Nginx 将 Web 请求代理到基于 .Net HttpListener 的 Json 服务的想法

ios - 在 iOS 中发送 SPDY 请求导致 NSUrlSession 出现 "The request timed out"错误

java - WSO2 和 Java 客户端定期请求