Skip to content
WeftKitBeta

Ecosystem Quickstart

This guide walks you through deploying a 3-node WeftKit Relational cluster with Raft replication, service discovery, and a Pool Manager proxy.

Prerequisites

  • Three Linux hosts accessible to each other on the network
  • WeftKit binaries installed on each host
  • Open ports: 7474 (Discovery), 5432 (Standalone), 6432 (Pool Manager)

Step 1: Start Discovery on Each Node

toml
# /etc/weftkit/discovery.toml
[discovery]
bind = "0.0.0.0:7474"
seeds = ["node1:7474", "node2:7474", "node3:7474"]
gossip_interval_ms = 500
bash
weftkit-discovery --config /etc/weftkit/discovery.toml

Step 2: Start Standalone on Each Node

toml
# /etc/weftkit/standalone.toml
[standalone]
module = "relational"
bind = "0.0.0.0:5432"
protocol = "postgresql"

[database]
data_dir = "/var/lib/weftkit/data"
max_memory_bytes = 4294967296
bash
weftkit-standalone --config /etc/weftkit/standalone.toml

Step 3: Enable Distribution

toml
# /etc/weftkit/distribution.toml
[distribution]
discovery_endpoint = "http://localhost:7474"
group = "relational-primary"
consistency = "strong"
bash
weftkit-dist --config /etc/weftkit/distribution.toml

Step 4: Start Pool Manager

toml
# /etc/weftkit/pool.toml
[pool]
backends = ["node1:5432", "node2:5432", "node3:5432"]
bind = "0.0.0.0:6432"
max_client_connections = 100000
routing = "least_conn"
bash
weftkit-pool --config /etc/weftkit/pool.toml

Step 5: Connect

bash
psql -h gateway -p 6432 -U myuser mydb

Your application connects to Pool Manager on port 6432 and gets automatic read/write routing to the 3-node cluster.