【发布时间】:2017-02-01 00:08:11
【问题描述】:
我的机器上的一个地窖组中有三个 karaf 节点。第一个节点(lb_node)用作负载平衡器,另外两个节点(1_node 和2_node)用作服务节点(具有已部署的功能)。两个节点都有/service 地址可用。我已经在集群上安装了cellar-http-balancer 功能。另外,我在 1_node 和 2_node 上都安装了本地示例功能。
问题是,当我启动1_node 和2_node 时,他们的服务没有在lb_node 中正确注册。 http-list 来自lb_node 的输出:
ID | Servlet | Servlet-Name | State | Alias | Url
103 | CellarBalancerProxyServlet | ServletModel-10 | Failed | /features | [/features/*]
103 | CellarBalancerProxyServlet | ServletModel-11 | Failed | /jolokia | [/jolokia/*]
103 | CellarBalancerProxyServlet | ServletModel-12 | Failed | /gogo | [/gogo/*]
103 | CellarBalancerProxyServlet | ServletModel-9 | Failed | /instance | [/instance/*]
103 | CellarBalancerProxyServlet | ServletModel-13 | Failed | /services | [/services/*]
103 | CellarBalancerProxyServlet | ServletModel-8 | Deployed | /jolokia | [/jolokia/*]
103 | CellarBalancerProxyServlet | ServletModel-14 | Failed | /system/console/res | [/system/console/res/*]
103 | CellarBalancerProxyServlet | ServletModel-15 | Failed | /system/console | [/system/console/*]
103 | CellarBalancerProxyServlet | ServletModel-3 | Deployed | /gogo | [/gogo/*]
103 | CellarBalancerProxyServlet | ServletModel-2 | Deployed | /instance | [/instance/*]
103 | CellarBalancerProxyServlet | ServletModel-7 | Deployed | /features | [/features/*]
103 | CellarBalancerProxyServlet | ServletModel-6 | Deployed | /services | [/services/*]
103 | CellarBalancerProxyServlet | ServletModel-5 | Deployed | /system/console | [/system/console/*]
103 | CellarBalancerProxyServlet | ServletModel-4 | Deployed | /system/console/res | [/system/console/res/*]
如您所见,只有一个节点注册地址。当我在浏览器中输入lb_node url 以检查其他节点的功能是否有效时,它确实有效。但是当我关闭注册节点时,lb_node 将不再充当代理。它抛出java.net.ConnectException: Connection refused
在教程https://karaf.apache.org/manual/cellar/latest-4/#_http_balancer 中,只有一个节点有服务和一个平衡器,这不是我的情况。
有什么方法可以通过 karaf 和 cellar 实现 HTTP 负载均衡的主动/主动集群?
【问题讨论】:
-
投反对票的人能写出他为什么这样做吗?
标签: java osgi apache-karaf