Add-ServiceFabricConfigurationParameterOverrides
Adds one or more temporary configuration override(s) to the specified cluster node.
Syntax
Default (Default)
Add-ServiceFabricConfigurationParameterOverrides
-NodeName <String>
-ConfigParameterOverrideList <System.Collections.Generic.List`1[System.Fabric.Description.ConfigParameterOverride]>
[-Force]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
Dynamic node configuration parameters can be temporarily changed, though some require the -Force
flag, as they are generally unsafe to change. Only parameters with simple types can be overridden; complex type parameters are not overridable.
Examples
Example 1: Enable the command in the cluster manifest
This command is disabled by default. Enable it by adding the following dynamic configuration parameter to the cluster manifest:
<Section Name="Testability">
<Parameter Name="AllowConfigurationOverrides" Value="true" />
</Section>
Example 2: Add override to config parameter for placement / load balancing
$timeout = New-TimeSpan -Hours 3 -Minutes 30
$configOverride = New-Object -TypeName System.Fabric.Description.ConfigParameterOverride(
"PlacementAndLoadBalancing",
"DummyPLBEnabled",
"True",
$timeout)
$configOverrideList = New-Object 'System.Collections.Generic.List[System.Fabric.Description.ConfigParameterOverride]'
$configOverrideList.Add($configOverride)
Add-ServiceFabricConfigurationParameterOverrides -NodeName DB.0 -ConfigParameterOverrideList $configOverrideList [-Force]
Example 3: Add config overrides to each node
Get-ServiceFabricNode | ForEach-Object {Add-ServiceFabricConfigurationParameterOverrides -NodeName $_.NodeName -ConfigParameterOverrideList $confOverrideList}
Example 4: Verify an override was successfully applied to a node
To verify an override was successfully applied to the node, either call the Get-ServiceFabricConfigurationOverrides command or check the ConfigurationOverride.xml file on the node, for example:
<Settings xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Section Name="PlacementAndLoadBalancing">
<Parameter SectionName="PlacementAndLoadBalancing" Name="MoveParentToFixAffinityViolation" Value="True" Timeout="2019-11-20 14:33:24.326" PersistAcrossUpgrade="false" IsEncrypted="false" Type="" />
</Section>
</Settings>
Parameters
-ConfigParameterOverrideList
List of objects specifying the SectionName, ParameterName, and ParameterValue (and optional timeout value, see Example 1) for each desired configuration override.
The optional timeout value specifies the duration of the override. Default is 1 day; maximum duration is 7 days.
Parameter properties
Type: | System.Collections.Generic.List`1[System.Fabric.Description.ConfigParameterOverride] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Force
Forces configuration parameters that are otherwise non-overridable to be overriden. Parameters requiring this flag are generally unsafe to change.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-NodeName
Name of the cluster node to which the configuration override will apply.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TimeoutSec
Specifies the time-out period, in seconds, for the operation.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.