Run Distributed (2-Node Setup)
This guide walks you through running Clustron DKV in distributed mode.
You can run this setup in two ways:
- Single machine β run multiple nodes on one machine
- Multiple machines (servers) β run one node per machine
In both cases, Clustron forms a distributed cluster.
Prerequisitesβ
- Clustron installed
- PowerShell 7+
- Required ports open (7801, 7811, 7861)
Choose Your Setupβ
Option 1: Single Machine (Multiple Nodes)β
If you only have one machine, you can still run a distributed cluster.
- Each machine has one manager
- You connect to only one manager (localhost)
- Use
InstanceCountto run multiple nodes
Manager Connectionβ
Connect-DkvManager -Managers localhost:7801
Store Behaviorβ
InstanceCount = number of nodes to run on this machine
Ports are assigned automatically:
ClustronPortβ starting cluster portClientPortβ starting client port
For each additional node, ports are incremented:
ClustronPort = 7811 β 7811, 7812, ...
ClientPort = 7861 β 7861, 7862, ...
Option 2: Multiple Machines (Servers)β
If you have multiple machines:
- Each machine runs one manager
- You must connect to all managers
- Each machine typically runs one node (
InstanceCount = 1)
Manager Connectionβ
Connect-DkvManager -Managers 10.0.0.11:7801,10.0.0.12:7801
Understanding the Setupβ
In distributed mode:
- Managers coordinate the cluster (one per machine)
- Store instances (nodes) host the data
- Clients connect to any node
1. Create the Storeβ
New-DkvStore `
-Name TestStore `
-InstancePrefix node `
-InstanceCount 2 `
-ClustronPort 7811 `
-ClientPort 7861
- Single machine β set
InstanceCount > 1 - Multiple machines β use
InstanceCount = 1per machine
2. Start the Clusterβ
Start-DkvStore TestStore
This starts all configured nodes and forms the cluster.
3. Connect a Clientβ
Connect-DkvStore `
-StoreName TestStore `
-Endpoints 10.0.0.11:7861
You only need to provide a single endpoint (seed server).
- The client will automatically discover all nodes in the cluster
- You do not need to list every server manually
What is an Endpoint?β
An endpoint is:
<Machine/IP>:<ClientPort>
Machine/IPβ the server running the nodeClientPortβ the port specified during store creation
Examplesβ
localhost:7861
10.0.0.11:7861
Even if your cluster has multiple nodes, providing one valid endpoint is enough for the client to connect to the entire cluster.
You can provide multiple endpoints for resilience if needed.
4. Verify Operationβ
Set-DkvItem -Key "hello" -Value "world"
Get-DkvItem -Key "hello"
---
## Key Characteristics
* One manager per machine
* Multiple nodes per machine (optional)
* Data and coordination are shared across nodes
* Supports distributed locks, counters, and watch subscriptions
---
## Whatβs Next
π Continue to **Configuration (appsettings.json)** to manage setup via configuration
π Or explore **First Operations (Put / Get / Delete)** to use the API