Namespace Public Multi-Host Example
Run namespace dataplane nodes on two Linux VMs against one public controller endpoint.
This example splits namespace dataplane nodes across two Linux hosts while the controller and Postgres run on a third host. It uses the checked-in config set under examples/ns-public/.
Linux prerequisites
- Three reachable Linux machines:
- controller host (runs Docker services)
- VM1 dataplane host
- VM2 dataplane host
- Controller host: Docker Engine +
docker compose. - VM1/VM2 hosts:
sudo,iproute2, and eithercargoor a prebuiltnextminibinary. - Network reachability from VM1/VM2 to
controller_addron TCP port3000.
Namespace-specific behavior from this example:
VM1-config.tomlandVM2-config.tomlboth enable:auto_enable_ip_forward = trueauto_add_forward_rules = trueauto_add_nat = true
VM2-config.tomlsetsnode_id_offset = 5so VM2 node IDs do not overlap VM1.cleanup.shremoves host veth interfaces; run it only on the dataplane hosts used for this test.
1. Prepare config files on each host
The ns-public example does not use a generator script; edit the three TOML files directly.
On the controller host, confirm examples/ns-public/controller-config.toml matches your node count (default ring with n_nodes = 10).
On VM1 and VM2, update both interface names and controller endpoint in:
examples/ns-public/VM1-config.tomlexamples/ns-public/VM2-config.toml
By default these files assume public_network_interface = "ens3" and controller_addr = "206.12.95.232:3000".
2. Start controller and Postgres (controller host)
From repository root on the controller host:
docker compose -f examples/ns-public/docker-compose.yml up --buildThis launches:
postgres(withnextminiDB initialized fromcontroller/init.sql)controller(readsexamples/ns-public/controller-config.toml)
3. Start VM1 dataplane
From repository root on VM1:
cargo build -p nextmini --release
sudo -E env RUST_LOG=info ./target/release/nextmini --config-path examples/ns-public/VM1-config.toml4. Start VM2 dataplane
From repository root on VM2:
cargo build -p nextmini --release
sudo -E env RUST_LOG=info ./target/release/nextmini --config-path examples/ns-public/VM2-config.tomlBecause VM2-config.toml uses node_id_offset = 5, VM2 contributes nodes 6..10 while VM1 contributes 1..5.
5. Verify cluster state
On the controller host, verify all namespace nodes registered:
docker exec postgres psql -U pgusr -d nextmini -c \
"SELECT COUNT(*) AS nodes_connected, COUNT(DISTINCT node_id) AS unique_nodes FROM nodes;"For the default configs, expect 10 connected and 10 unique nodes.
You can also watch controller logs:
docker compose -f examples/ns-public/docker-compose.yml logs -f controller6. Cleanup
On VM1 and VM2:
- Stop dataplane processes with
Ctrl+C. - Run veth cleanup:
./examples/ns-public/cleanup.shOn the controller host, stop controller and Postgres:
docker compose -f examples/ns-public/docker-compose.yml down