我最近开始使用 Service Fabric。我在 Azure 上添加了一个新的 Service Fabric 群集(不安全),并使用 2 个无状态 Web API 服务创建了一个演示解决方案,如下所示:
AnotherAPI 的端点配置如下:
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input" Port="8698" />
</Endpoints>
我可以使用本地端点访问默认 Controller (ValuesController):
http://localhost:8698/api/values
但是当我尝试使用 azure 端点时,我在 Chrome 上收到 ERR_CONNECTION_TIMED_OUT 错误。
http://{azure-ip-address}:8698/api/values
我有什么遗漏的吗?
最佳答案
您必须通过负载均衡器探针在 Azure 集群中打开该端口。您可以在集群创建时通过 ARM 模板或事后执行此操作。对于现有集群,请转到资源组,然后转到 LB 平衡器,然后进行探测。 SF 中默认开放的端口是 19080。如果您只是切换到该端口,则在不使用 SSL 的情况下它也可以工作。
关于azure - 尝试访问 Service Fabric 服务时出现 ERR_CONNECTION_TIMED_OUT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38070891/