简体   繁体   English

在 Visual Studio 中为 5 节点群集调试 Azure Service Fabric 应用程序

[英]Debugging Azure Service Fabric Application in Visual Studio for 5 node cluster

I am having a very simple use case where I need to setup a 5 node cluster environment in Azure Service Fabric and then debug the code.我有一个非常简单的用例,我需要在 Azure Service Fabric 中设置一个 5 节点集群环境,然后调试代码。

The problem that I am facing is that when I deploy my application locally for a 5 node cluster, since there is only one node that can use my port on machine, my application just runs on 1 node cluster and the deployment fails on other 4 nodes because the port is unavailable.我面临的问题是,当我为 5 节点集群在本地部署我的应用程序时,由于只有一个节点可以使用我的机器上的端口,我的应用程序仅在 1 个节点集群上运行,而在其他 4 个节点上部署失败因为端口不可用。

I am looking for steps to deploy and test multi-node cluster in local environment.我正在寻找在本地环境中部署和测试多节点集群的步骤。 Any lead will be appreciated and is this possible also to test locally a multi-node Azure Service Fabric cluster.任何线索都将不胜感激,这是否也可以在本地测试多节点 Azure Service Fabric 群集。

Can you try this?:你可以试试这个吗?:

Use environment specific settings to define the port number:使用特定于环境的设置来定义端口号:

  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="Web1Pkg" ServiceManifestVersion="1.0.0" />
    <ResourceOverrides>
      <Endpoints>
        <Endpoint Name="ServiceEndpoint" Port="[MyWebAPI_PortNumber]"/>
      </Endpoints>
    </ResourceOverrides>
    <ConfigOverrides />
  </ServiceManifestImport>

Define an empty default value in the app manifest, to use a random port by default:在应用清单中定义一个空的默认值,默认使用随机端口:

<Parameters>
  <Parameter Name="MyWebAPI_PortNumber" DefaultValue="" />
</Parameters>

Define an environment specific override value in cloud.xml, to use port 80 in that environment:在 cloud.xml 中定义特定于环境的覆盖值,以在该环境中使用端口 80:

  <Parameters>
    <Parameter Name="MyWebAPI_PortNumber" Value="80" />
  </Parameters>
  • In the production cluster you can use the same port on every node.在生产集群中,您可以在每个节点上使用相同的端口。
  • On your local 5-node development cluster, you'd use different ports.在本地 5 节点开发集群上,您将使用不同的端口。

More info here .更多信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Service Broker /外部应用程序激活和Visual Studio调试 - Service Broker / External Application Activation and Visual Studio Debugging 复制在Azure Service Fabric群集上部署的服务 - Replication of Services deployed on Azure Service Fabric Cluster 在Azure中收集Service Fabric群集日志 - Collect Service Fabric Cluster logs in Azure 在Visual Studio中调试Azure功能 - Debugging Azure functions in Visual Studio 在Visual Studio发布应用程序中进行调试 - Debugging in visual studio release application Azure Service Fabric持续集成在Visual Studio Team Services中失败(是VSO) - Azure Service Fabric continuous integration fails in Visual Studio Team Services (was VSO) Service Fabric正在Visual Studio版本上删除ResourceOverrides - Service Fabric is Removing the ResourceOverrides on Visual Studio build 在Visual Studio中将Windows Azure移动服务添加到移动应用程序 - Adding Windows Azure Mobile Service to the Mobile Application in Visual Studio Rotativa在Azure中的服务结构节点上崩溃 - Rotativa crashes on service fabric node in Azure 将Visual Studio中的C#Stateful Service Fabric应用程序部署到Linux - Deploy a C# Stateful Service Fabric application from Visual Studio to Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM