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
| Parameter | Type | Required | Description |
|---|---|---|---|
-Name | string | Yes | Name of the store to create. Position 0. |
-ReplicationFactor | int | Yes | Total 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. |
-BaseClusterPort | int | Yes | First Clustron gossip (cluster) port on each machine; incremented per process. |
-BaseClientPort | int | Yes | First Zaris client port on each machine; incremented per process. |
-PartitionsPerNode | int | No | Target 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. |
-ReplicationMode | ReplicationMode | No | When a write is considered durable. Async (default) returns after the local write; Sync waits for replica acknowledgement. |
-WriteQuorumPolicy | WriteQuorumPolicy | No | Quorum policy for Sync replication. All (default), Majority (floor(RF/2)+1), or BestEffort (failures logged, write still succeeds). |
-AllowReplicaReads | switch | No | Allow clients to read from replica nodes; replica reads may return slightly stale data. |
-Tracing | switch | No | Enable native OpenTelemetry tracing in the new store's config (sample ratio 1.0, console exporter). Off by default. |
-Managers | string[] | No | Management Service endpoints (host, host:port, or URL) to target. When omitted, the active workspace/connected managers are used. |
-Port | int | No | Management Service port used for bare-host managers or localhost fallback. Default 7801. |
-Token | string | No | Admin bearer token for authenticated control-plane calls; falls back to the token from the active workspace. |
-TimeoutSec | int | No | Per-request timeout in seconds. Default 30. |
-Parallel | switch | No | Fan the create out to all resolved managers concurrently. |
-FailFast | switch | No | Stop 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.