ERR_CONNECTION_TIMED_OUT 尝试访问 Service Fabric 服务时
ERR_CONNECTION_TIMED_OUT when trying to access a Service Fabric service
我最近才开始接触 Service Fabric。我在 Azure (unsecure) 上添加了一个新的 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>
我可以使用本地端点访问默认控制器 (ValuesController):
http://localhost:8698/api/values
但是当我尝试使用 Azure 端点时,我在 Chrome 上收到 ERR_CONNECTION_TIMED_OUT 错误。
http://{azure-ip-address}:8698/api/values
有什么我遗漏的吗?
您必须通过 Load Balancer Probe 在 Azure 集群中打开该端口。您可以在集群创建时通过 ARM 模板或事后执行此操作。对于现有集群,转到资源组,然后是 LB 平衡器,然后是探测。 SF 中的默认开放端口是 19080。如果你只是切换到那个端口,如果你没有使用 SSL,它就会工作。
我最近才开始接触 Service Fabric。我在 Azure (unsecure) 上添加了一个新的 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>
我可以使用本地端点访问默认控制器 (ValuesController):
http://localhost:8698/api/values
但是当我尝试使用 Azure 端点时,我在 Chrome 上收到 ERR_CONNECTION_TIMED_OUT 错误。
http://{azure-ip-address}:8698/api/values
有什么我遗漏的吗?
您必须通过 Load Balancer Probe 在 Azure 集群中打开该端口。您可以在集群创建时通过 ARM 模板或事后执行此操作。对于现有集群,转到资源组,然后是 LB 平衡器,然后是探测。 SF 中的默认开放端口是 19080。如果你只是切换到那个端口,如果你没有使用 SSL,它就会工作。