Search code examples
powershellvisual-studio-2017azure-service-fabric

Changing the configuration file in current use


Service fabric allows you to run the cluster with various configurations:

enter image description here

How do I switch the cluster to run under a different configuration file on my localhost?


Solution

  • Well, I'd say you have to remove the existing cluster first. For instance, if we consider 'Switch cluster mode' button that is available in SF Local Cluster Manager, then here is what it does according to the documentation -

    When you change the cluster mode, the current cluster is removed from your system and a new cluster is created. The data stored in the cluster is deleted when you change cluster mode.

    So here is the path that should work for you -

    1. Run RemoveServiceFabricCluster.ps1 to remove Service Fabric from each machine in the configuration(the one that you'll pass as a parameter to this command)
    2. Run CleanFabric.ps1 to remove Service Fabric from the current machine
    3. Run CreateServiceFabricCluster.ps1 passing this time a new config file