Multi-DC Swarm Dataplane
Runs controller and database on one host, then deploys dataplane replicas from a Docker Swarm manager across worker hosts.
This example splits control-plane and dataplane responsibilities across machines:
- Controller host runs
examples/multi-dc/controller-standalone.yml. - Swarm manager and workers run dataplane tasks from
examples/multi-dc/dataplane-swarm.yml.
Use this when controller/database should stay on a dedicated instance and dataplane nodes should be scheduled across multiple DC VMs.
If you also want to run external HTTP traffic across this swarm dataplane, continue with Swarm curl Client/Server Over Nextmini after dataplane services are stable.
Prerequisites
You need:
- One controller/database host.
- One swarm manager host.
- One or more swarm worker hosts.
- Docker installed on all hosts.
examples/multi-dc/dataplane-swarm.yml expects the controller endpoint through CONTROLLER_HOST, so keep the controller host reachable from manager and workers on TCP 3000.
Deployment order
1. Controller host: build and start controller + Postgres
On the controller host:
cd /path/to/nextmini/examples/multi-dc
docker build -t nextmini_controller -f ../../controller/Dockerfile ../../
docker pull postgres:alpineBefore launch, make sure controller-config.toml matches your intended node count. By default it is n_nodes = 15.
rg 'full_mesh_config' controller-config.tomlStart the control-plane services:
docker compose -f controller-standalone.yml up -d2. Manager and workers: build dataplane image
On every swarm node (manager and workers):
cd /path/to/nextmini/examples/multi-dc
docker build -t nextmini_datapath -f ../../dataplane/Dockerfile ../../3. Initialize swarm and join workers
On the manager:
docker swarm init --advertise-addr <MANAGER_IP>On each worker, run the join command printed by the manager:
docker swarm join --token <WORKER_TOKEN> <MANAGER_IP>:2377Verify from the manager:
docker node ls4. Manager: generate deploy file with controller address
dataplane-swarm.yml uses REPLACE_WITH_MANAGER_IP as a placeholder for CONTROLLER_HOST. Replace it with the real controller host IP and create a deploy file:
cd /path/to/nextmini/examples/multi-dc
CONTROLLER_IP=<CONTROLLER_PUBLIC_OR_PRIVATE_IP>
sed "s/REPLACE_WITH_MANAGER_IP/${CONTROLLER_IP}/g" dataplane-swarm.yml > dataplane-deploy.ymlDeploy dataplane services from the manager:
docker stack deploy -c dataplane-deploy.yml nextminiVerify
On the controller host:
cd /path/to/nextmini/examples/multi-dc
docker compose -f controller-standalone.yml ps
docker compose -f controller-standalone.yml logs --tail 100 controllerOn the manager:
docker service ls
docker service ps nextmini_dataplane
docker service logs --tail 100 nextmini_dataplaneIf you run external traffic tests later (for example swarm-curl), verify dataplane services are stable first and only then insert routes.
Tear down
On the manager:
docker stack rm nextminiOn the controller host:
cd /path/to/nextmini/examples/multi-dc
docker compose -f controller-standalone.yml downOptional: if you are done with this cluster, leave swarm mode on workers and manager:
docker swarm leave -fLarge Node Count on One Host
Generates and runs a large Docker Compose topology (default 100 dataplane nodes) for scale testing on a single machine.
Swarm curl Client/Server Over Nextmini
Deploys external curl client and server services into the swarm network, inserts explicit routes, and validates end-to-end HTTP traffic.