Skip to main content

New-ZrStore

Creates a new Zaris store across the connected managers, computing a node layout from the requested partitions-per-node and replication factor and provisioning it on every connected machine through the Management Service.

Syntax

New-ZrStore
-Name <string>
-ReplicationFactor <int>
-BaseClusterPort <int>
-BaseClientPort <int>
[-PartitionsPerNode <int>]
[-ReplicationMode <ReplicationMode>]
[-WriteQuorumPolicy <WriteQuorumPolicy>]
[-AllowReplicaReads]
[-Tracing]
[-Managers <string[]>] [-Port <int>] [-Token <string>]
[-TimeoutSec <int>] [-Parallel] [-FailFast]

Description

New-ZrStore derives a node layout from -PartitionsPerNode and -ReplicationFactor, then creates the store on every connected machine, assigning cluster and client ports starting from the given base ports and incrementing per process. The total number of processes on each machine is PartitionsPerNode * ReplicationFactor.

The cmdlet needs an active workspace (see New-ZrWorkspace / Use-ZrWorkspace) or an explicit -Managers list. It targets supervisor-mode managers; it cannot create stores on an attach-mode manager, which instead reports the Register-ZrStore adoption path.

Parameters

ParameterTypeRequiredDescription
-NamestringYesName of the store to create. Position 0.
-ReplicationFactorintYesTotal copies of each partition (primary + replicas). In production this should be ≤ the number of connected machines so replicas land on distinct machines; a smaller machine count is allowed for single-machine testing with a warning.
-BaseClusterPortintYesFirst Clustron gossip (cluster) port on each machine; incremented per process.
-BaseClientPortintYesFirst Zaris client port on each machine; incremented per process.
-PartitionsPerNodeintNoTarget partitions per machine (total = PartitionsPerNode × live nodes, recalculated on membership change). Default 1, matching production topology. Raise it for local/single-node testing of partition-aware behavior.
-ReplicationModeReplicationModeNoWhen a write is considered durable. Async (default) returns after the local write; Sync waits for replica acknowledgement.
-WriteQuorumPolicyWriteQuorumPolicyNoQuorum policy for Sync replication. All (default), Majority (floor(RF/2)+1), or BestEffort (failures logged, write still succeeds).
-AllowReplicaReadsswitchNoAllow clients to read from replica nodes; replica reads may return slightly stale data.
-TracingswitchNoEnable native OpenTelemetry tracing in the new store's config (sample ratio 1.0, console exporter). Off by default.
-Managersstring[]NoManagement Service endpoints (host, host:port, or URL) to target. When omitted, the active workspace/connected managers are used.
-PortintNoManagement Service port used for bare-host managers or localhost fallback. Default 7801.
-TokenstringNoAdmin bearer token for authenticated control-plane calls; falls back to the token from the active workspace.
-TimeoutSecintNoPer-request timeout in seconds. Default 30.
-ParallelswitchNoFan the create out to all resolved managers concurrently.
-FailFastswitchNoStop at the first manager that returns an error.

Examples

Create a production-topology store (one partition per machine) with a replication factor of 2.

New-ZrWorkspace prod -Managers @('10.0.0.11:7801','10.0.0.12:7801') -Activate

New-ZrStore -Name orders -ReplicationFactor 2 -BaseClusterPort 7811 -BaseClientPort 7861

Create a local test store with four partitions per machine so partition-aware behavior can be observed on a single host.

New-ZrStore -Name dev -PartitionsPerNode 4 -ReplicationFactor 2 -BaseClusterPort 7811 -BaseClientPort 7861

Create a store with synchronous majority-quorum replication and issue the create to every manager concurrently.

New-ZrStore -Name orders `
-ReplicationFactor 3 -BaseClusterPort 7811 -BaseClientPort 7861 `
-ReplicationMode Sync -WriteQuorumPolicy Majority -Parallel

Output

Results are rendered as a per-manager table with Manager, Action (CreateStore), Result (SUCCESS/ERROR), and a message column.