Skip to main content

Overview

The Router + Coordinator deployment is the recommended setup for production environments. It provides centralized metadata management, dynamic configuration updates, and support for multiple router instances. In this deployment mode:
  • A Coordinator manages the sharding metadata and configuration
  • QDB (etcd cluster) stores the cluster metadata persistently
  • Multiple Routers connect to the Coordinator and share the same configuration
  • Routers must be registered and unregistered with the Coordinator
  • Configuration can be updated dynamically without router restarts

Setup

1. Deploy etcd Cluster

Set up an etcd cluster to serve as the QDB. For production, we recommend using a 3-node cluster. Example: Single-node etcd (for testing)
For production, follow the etcd clustering guide.

2. Configure the Coordinator

Create a coordinator configuration file:
coordinator.yaml

3. Start the Coordinator

4. Configure Sharding Rules

Connect to the Coordinator’s admin console:
Configure your sharding setup:

5. Configure the Router

Create a router configuration file:
router.yaml

6. Start the Router

7. Register the Router

Connect to the coordinator’s admin console and register the router:

8. Connect

Clients can now connect to the router:

Managing the Deployment

Adding More Routers

Create a new router configuration with different ports, start it, and register:

Updating Configuration Dynamically

All configuration changes are made through the Coordinator’s admin console:
Changes are automatically propagated to all registered routers.

Unregistering a Router

Before shutting down a router:
Or unregister all routers:

Monitoring

Check Router Status

On the Coordinator’s admin console:

Configuration Reference

For complete options: