Service-fabric: How to get the cluster id

Created on 29 Jun 2018  路  5Comments  路  Source: microsoft/service-fabric

Guys, I need a way to get the clusterid, but out of service fabric application, I mean, I have a SF stateless service which installs a windows service on every node, so I need to get the cluster id, from that service, I was thinking to get the clusterManifest.xml or FabricHostSettings.xml from D:\SvcFab but I'm not sure if SF ALWAYS uses that path. Any suggestions?

Thanks in advance!

area-SFRP status-last6months type-question

Most helpful comment

So there should always be a file called ClusterManifest.xml in the folder defined by the FabricDataRoot variable. This is configurable by the user when you deploy the cluster, but you can determine it by looking at the registry key under HKLM\SOFTWARE\Microsoft\Service Fabric. This defaults to D:\SvcFab.

All 5 comments

Is this an Azure deployment of Service Fabric? Generally speaking we will try to use D:\SvcFab but it is configurable in the Extension settings and may change in the future.

We can consider adding an API to get this programatically from Service Fabric in the future.

Yes it is.

So there should always be a file called ClusterManifest.xml in the folder defined by the FabricDataRoot variable. This is configurable by the user when you deploy the cluster, but you can determine it by looking at the registry key under HKLM\SOFTWARE\Microsoft\Service Fabric. This defaults to D:\SvcFab.

Accidental reopen? @craftyhouse is there a reason this was assigned to me?

Closing issue as workaround was provided. There is no plan to add support for getting the cluster ID programmatically.

Was this page helpful?
0 / 5 - 0 ratings