Skip to content

Instantly share code, notes, and snippets.

@ReubenBond
Last active March 29, 2024 14:27
Show Gist options
  • Save ReubenBond/8f547b2d304c06ec34f2 to your computer and use it in GitHub Desktop.
Save ReubenBond/8f547b2d304c06ec34f2 to your computer and use it in GitHub Desktop.
Speedy Service Fabric Dev Cluster Upgrades

This manifest allows for faster Fabric service upgrades for your dev cluster. No guarantees ;)

It works by reducing the number of nodes from 5 to 3, shortening some timespans, and using a local folder for your image store instead of the in-cluster (replicated) image store.

  1. Overwrite the ClusterManifestTemplate.xml file at %PROGRAMFILES%\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure with the one provided here.
  2. Create the directory c:\tmp\ImageStore, or create a temprorary directory and update the manifest to match.
  3. In an administrative PowerShell window, execute the following
cd "$env:programfiles\Microsoft SDKs\Service Fabric\ClusterSetup"
.\DevClusterSetup.ps1
<?xml version="1.0" encoding="utf-8"?>
<!--
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
The settings used within this ClusterManifest are expressly for use only
within a developer single-box environment. Any use of these settings outside
of that environment are highly likely to produce incorrect, and misperforming
systems.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
-->
<ClusterManifest
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
Name="ComputerName-Local-Cluster"
Version="1.0">
<NodeTypes>
<NodeType Name="NodeType1">
<Endpoints>
<ClientConnectionEndpoint Port="19000" />
<LeaseDriverEndpoint Port="19001" />
<ClusterConnectionEndpoint Port="19002" />
<HttpGatewayEndpoint Port="19007" Protocol="http" />
<ServiceConnectionEndpoint Port="19006" />
<ApplicationEndpoints StartPort="30001" EndPort="31000" />
</Endpoints>
<PlacementProperties>
<Property Name="IsPublic" Value="true"/>
</PlacementProperties>
</NodeType>
<NodeType Name="NodeType2">
<Endpoints>
<ClientConnectionEndpoint Port="19010" />
<LeaseDriverEndpoint Port="19011" />
<ClusterConnectionEndpoint Port="19012" />
<HttpGatewayEndpoint Port="19017" Protocol="http" />
<ServiceConnectionEndpoint Port="19016" />
<ApplicationEndpoints StartPort="31001" EndPort="32000" />
</Endpoints>
<PlacementProperties>
<Property Name="IsPublic" Value="false"/>
</PlacementProperties>
</NodeType>
<NodeType Name="NodeType3">
<Endpoints>
<ClientConnectionEndpoint Port="19020" />
<LeaseDriverEndpoint Port="19021" />
<ClusterConnectionEndpoint Port="19022" />
<HttpGatewayEndpoint Port="19027" Protocol="http" />
<ServiceConnectionEndpoint Port="19026" />
<ApplicationEndpoints StartPort="32001" EndPort="33000" />
</Endpoints>
<PlacementProperties>
<Property Name="IsPublic" Value="false"/>
</PlacementProperties>
</NodeType>
</NodeTypes>
<Infrastructure>
<WindowsServer IsScaleMin="true">
<NodeList>
<Node NodeName="Node.1" IPAddressOrFQDN="ComputerFullName" IsSeedNode="true" NodeTypeRef="NodeType1" FaultDomain="fd:/FD01" UpgradeDomain="UD1" />
<Node NodeName="Node.2" IPAddressOrFQDN="ComputerFullName" IsSeedNode="true" NodeTypeRef="NodeType2" FaultDomain="fd:/FD02" UpgradeDomain="UD1" />
<Node NodeName="Node.3" IPAddressOrFQDN="ComputerFullName" IsSeedNode="true" NodeTypeRef="NodeType3" FaultDomain="fd:/FD03" UpgradeDomain="UD1" />
</NodeList>
</WindowsServer>
</Infrastructure>
<FabricSettings>
<Section Name="Security">
<Parameter Name="ClusterCredentialType" Value="None" />
<Parameter Name="ServerAuthCredentialType" Value="None" />
</Section>
<Section Name="FailoverManager">
<!-- expected cluster size allows the placement to start when the cluster is started. This value should be less than total number of nodes
as without it the FailoverManager will not start the placement of the user services. This value should be 80% to 90% of the cluster size.
-->
<Parameter Name="ExpectedClusterSize" Value="3" />
<!-- The default target and min replica set sizes are 7 and 3. The below configuration is not required for cluster that have 7 or more nodes. -->
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="2" />
<Parameter Name="ReconfigurationTimeLimit" Value="20" />
<Parameter Name="BuildReplicaTimeLimit" Value="20" />
<Parameter Name="CreateInstanceTimeLimit" Value="20" />
<Parameter Name="PlacementTimeLimit" Value="20" />
</Section>
<Section Name="ReconfigurationAgent">
<Parameter Name="ServiceApiHealthDuration" Value="20" />
<Parameter Name="ServiceReconfigurationApiHealthDuration" Value="20" />
<Parameter Name="LocalHealthReportingTimerInterval" Value="5" />
</Section>
<Section Name="ClusterManager">
<!-- The default target and min replica set sizes are 7 and 3. The below configuration is not required for cluster that have 7 or more nodes. -->
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="2" />
<Parameter Name="UpgradeStatusPollInterval" Value="1" />
<Parameter Name="UpgradeHealthCheckInterval" Value="1" />
<Parameter Name="FabricUpgradeStatusPollInterval" Value="1" />
<Parameter Name="FabricUpgradeHealthCheckInterval" Value="1" />
<Parameter Name="InfrastructureTaskProcessingInterval" Value="3" />
<Parameter Name="MinOperationTimeout" Value="3" />
</Section>
<Section Name="NamingService">
<!-- The default target and min replica set sizes are 7 and 3. The below configuration is not required for cluster that have 7 or more nodes. -->
<Parameter Name="TargetReplicaSetSize" Value="3" />
<Parameter Name="MinReplicaSetSize" Value="2" />
</Section>
<Section Name="Management">
<Parameter Name="ImageStoreConnectionString" Value="file:c:\tmp\ImageStore" />
<Parameter Name="ImageCachingEnabled" Value="false" />
</Section>
<Section Name="Hosting">
<Parameter Name="EndpointProviderEnabled" Value="true" />
<Parameter Name="RunAsPolicyEnabled" Value="true" />
<Parameter Name="DeactivationScanInterval" Value="60" />
<Parameter Name="DeactivationGraceInterval" Value="10" />
<Parameter Name="EnableProcessDebugging" Value="true" />
<Parameter Name="ServiceTypeRegistrationTimeout" Value="20" />
<Parameter Name="CacheCleanupScanInterval" Value="300" />
</Section>
<Section Name="HttpGateway">
<Parameter Name="IsEnabled" Value="true" />
</Section>
<Section Name="PlacementAndLoadBalancing">
<!-- balance the load on the cluster every 3 minutes. -->
<Parameter Name="MinLoadBalancingInterval" Value="200" />
</Section>
<Section Name="Federation">
<Parameter Name="UseV2NodeIdGenerator" Value="true" />
</Section>
<Section Name="Trace/Etw">
<Parameter Name="Level" Value="1" />
</Section>
<!-- Configure the DCA to cleanup the log folder only. The collection of the logs, performance counters and crashdumps is not performed on the local machine. -->
<Section Name="Diagnostics">
<Parameter Name="ProducerInstances" Value="ServiceFabricEtlFile, ServiceFabricPerfCtrFolder" />
<Parameter Name="MaxDiskQuotaInMB" Value="10240" />
</Section>
<Section Name="ServiceFabricEtlFile">
<Parameter Name="ProducerType" Value="EtlFileProducer" />
<Parameter Name="IsEnabled" Value="true" />
<Parameter Name="EtlReadIntervalInMinutes" Value=" 3" />
<Parameter Name="DataDeletionAgeInDays" Value="2" />
</Section>
<Section Name="ServiceFabricPerfCtrFolder">
<Parameter Name="ProducerType" Value="FolderProducer" />
<Parameter Name="IsEnabled" Value="true" />
<Parameter Name="FolderType" Value="WindowsFabricPerformanceCounters" />
<Parameter Name="DataDeletionAgeInDays" Value="2" />
</Section>
<Section Name="TransactionalReplicator">
<Parameter Name="MaxStreamSizeInMB" Value="64" />
</Section>
</FabricSettings>
</ClusterManifest>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment