azure-service-fabricservice-fabric-statefulservice-fabric-on-premises

Service Fabric - How to enable BackupRestoreService on my local dev cluster


I would like to get the backup and restore related functionality working inside the service fabric explorer for my local dev cluster. Any action I take related to backup/restore in the cluster manager ui throws a service not found exception currently, I believe due to the backup and restore service not running on the cluster.

I can't find any documentation pertaining to configuring the local dev cluster. The standalone cluster steps don't seem to apply. I have attempted to use sfctl to get the cluster configuration with sfctl sa-cluster config but the operations times out against my local dev cluster. I've tried the analogous Get-ServiceFabricClusterConfiguration from powershell module and get a timeout there as well.

For the time being I have built a code based backup and restore, but I really like the service and would like to see what I can do with it locally.


Solution

  • I tested this with cluster version 7.0.470.9590

    Verify BackupAndRestore service is available in your installation. C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\__FabricSystem_App{random-number}\BRS.Code.Current folder should exist with the correct binaries.

    Change your local cluster config. Your clusterconfig is located under: C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup

    So if your dev cluster is single node unsecure, you can change: C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\OneNode\ClusterManifestTemplate.json

    In the "addOnFeatures" tag you can add "BackupRestoreService" example:

    "addOnFeatures": [
       "DnsService",
       "EventStoreService",
       "BackupRestoreService"
    ]

    Under "fabricSettings" you then add the configuration for the backup and restore service:

    {
        "name": "BackupRestoreService",
        "parameters":  [
            {
                "name": "SecretEncryptionCertThumbprint",
                "value": "......YOURTHUMBPRINT....."
            }
        ]
    }
    

    After these steps you can reset your dev cluster from the system tray. (Right click the service fabric icon => Reset Local Cluster)

    When your cluster is restarted you can verify if the service is running by opening the cluster dashboard and open the system services. local dev cluster with backuprestore service

    You can use this approach to configure other system services as well.

    Note: updating your SDK may result in losing the changes made to your cluster config.