连接到本地 Service Fabric 集群

Connect to On Premises Service Fabric Cluster

我已经按照步骤 from Microsoft to create a Multi-Node On-Premises Service Fabric cluster. I've deployed a stateless app to the cluster and it seems to be working fine. When I have been connecting to the cluster I have used the IP Address of one of the nodes. Doing that, I can connect via Powershell using Connect-ServiceFabricCluster nodename:19000 and I can connect to the Service Fabric Explorer website (http://nodename:19080/explorer/index.html).

在线示例表明,如果我托管在 Azure 中,我可以连接到 http://mycluster.eastus.cloudapp.azure.com:19000 并且它会解析,但是我无法弄清楚本地的等效项。我尝试连接到我的示例集群:Connect-ServiceFabricCluster sampleCluster.domain.local:19000 但是 returns:

WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service... WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM... False WARNING: No such host is known

Connect-ServiceFabricCluster : No cluster endpoint is reachable, please check if there is connectivity/firewall/DNS issue.

我的设置中是否遗漏了什么?某处是否应该有一个中央 DNS 条目允许我连接到集群?还是我想做一些本地不支持的事情?

是的,您缺少负载均衡器。

这是我能找到的最好的帮助资源,如果它不可用,我会粘贴相关内容。

Reverse Proxy — When you provision a Service Fabric cluster, you have an option of installing Reverse Proxy on each of the nodes on the cluster. It performs the service resolution on the client’s behalf and forwards the request to the correct node which contains the application. In majority of the cases, services running on the Service Fabric run only on the subset of the nodes. Since the load balancer will not know which nodes contain the requested service, the client libraries will have to wrap the requests in a retry-loop to resolve service endpoints. Using Reverse Proxy will address the issue since it runs on each node and will know exactly on what nodes is the service running on. Clients outside the cluster can reach the services running inside the cluster via Reverse Proxy without any additional configuration.

来源:Azure Service Fabric is amazing

我有一个 Azure Service Fabric 资源 运行,但适用相同的规则。正如文章所述,您需要一个反向 proxy/load 平衡器来解决 运行 和 API 节点之间的问题,还要平衡节点之间的负载 运行 API。因此,健康探测也是必要的,以便负载均衡器知道哪些节点是向其发送流量的可行选择。

例如,Azure 立即创建了 2 条规则: 1. TCP/19080 上的 LBHttpRule,每 5 秒在端口 19080 上进行 TCP 探测,错误阈值为 2。 2. TCP/19000 上的 LBRule,每 5 秒在端口 19000 上进行一次 TCP 探测,错误阈值为 2。

要使这个面向前,您需要添加的是将端口 80 转发到您的服务 http 端口的规则。然后运行状况探测可以是一个 http 探测,它命中一个路径来测试 200 return.

进入集群后,可以正常解析服务,顺丰负责可用性。

在 Azure-land 中,这再次被抽象为使用类似 API 管理的东西进一步将其反向代理到 SSL。真是一团糟,但它有效。

设置负载均衡器后,您将拥有一个 IP 来管理、发布和常规流量。