Skip to main content

Set-ZrSiteReplication

Configures a single store's site role, mode, and merge policy directly, without touching any peer — the low-level, one-side primitive behind New-ZrSiteLink.

Syntax​

Set-ZrSiteReplication
[-Store] <string>
[-SiteId <string>] [-Label <string>]
[-Role <SiteRole>] [-Mode <SiteMode>] [-MergePolicy <MergePolicy>]
[-HomeSitePrefixes <string[]>] [-Restart]
[-Managers <string[]>] [-Port <int>] [-Token <string>] [-TimeoutSec <int>]
[-WhatIf] [-Confirm]

Description​

Set-ZrSiteReplication sets this store's site id, role, mode, merge policy, and home-site prefixes on each of its nodes, enabling site replication for the store. It is the one-sided form of New-ZrSiteLink: it does not configure or contact a peer. Existing peers are preserved — this is a role/mode edit, not a re-pairing — so use it to flip a site's role (for example, promote a passive mirror to active during failover) rather than to establish a new link. To pair two stores in one call, use New-ZrSiteLink instead.

The cmdlet applies the change to each resolved manager, prints a per-manager result, emits a StoreSiteApplyResult, and supports -WhatIf/-Confirm.

Parameters​

ParameterTypeRequiredDescription
-StorestringYesThe store to configure. Position 0.
-SiteIdstringNoSite id for the store.
-LabelstringNoCosmetic display label for the site.
-RoleSiteRoleNoActive (default) serves reads/writes and exposes a change feed; Passive mirrors a peer's change feed and refuses application writes.
-ModeSiteModeNoActivePassive (default) or ActiveActive.
-MergePolicyMergePolicyNoConflict convergence. LastWriterWins (default, HLC).
-HomeSitePrefixesstring[]NoKey prefixes homed to this site.
-RestartswitchNoRolling-restart each running node so it picks up the change immediately.
-Managersstring[]NoManagement Service endpoints to target. When omitted, the active workspace's managers are used.
-PortintNoManagement Service port for bare-host managers. Default 7801.
-TokenstringNoAdmin bearer token for authenticated control-plane calls.
-TimeoutSecintNoPer-request timeout in seconds. Default 30.

Supports -WhatIf and -Confirm.

Examples​

Promote a store's local site to active during a failover, applying it immediately.

Set-ZrSiteReplication -Store orders -Role Active -Mode ActivePassive -Restart