Replication — MDDB API
Leader-follower replication status and monitoring
Replication status #
GET /v1/replication/status
Returns the replication status of this node, including role, LSN, binlog stats, and connected followers (leader only).
Available for all roles: standalone, leader, and follower.
Replication Architecture #
MDDB uses a pull-based, single-leader replication model. Wait for the healthy flag to determine if the node is fully synced.
graph LR
L[Leader] -->|Binlog Stream| F1[Follower 1]
L -->|Binlog Stream| F2[Follower 2]
See Replication documentation for full setup instructions and monitoring.
Authorization: BearerAuth or APIKeyAuth or none
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Replication status | ReplicationStatusResponse (application/json) |
401 |
Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. | ErrorResponse (application/json) |
429 |
The client is over the API rate limit (MDDB_RATE_LIMIT_ENABLED=true, MDDB_RATE_LIMIT_REQUESTS per MDDB_RATE_LIMIT_WINDOW seconds). A call that embeds can also be refused by the collection's daily embedding budget, with a QuotaExceeded body. Since v2.19.8 (GO-054) a request over its tenant's or its credential's rate or concurrency limit is refused with a TenantLimit body. | anyOf RateLimitError | TenantLimit (application/json) |
401 example (application/json)
{
"error": "missing authentication"
}
Promote this cluster node to leader (admin) #
POST /v1/replication/promote
(v2.19.8, GO-051) Makes this node the leader of its cluster. Refused
when a reachable node has a later log. A reachable leader is asked to
step down first; this node waits until it holds the leader's last
entry and stands for election. force takes the leadership without
votes and is only allowed with automatic failover off. See
CLUSTER.
Authorization: BearerAuth or APIKeyAuth or none
Request body #
Content type application/json: object
| Property | Type | Description |
|---|---|---|
force |
boolean |
Default false. |
{
"force": false
}
Responses #
| Status | Description | Body |
|---|---|---|
200 |
This node leads | RoleChange (application/json) |
400 |
Not a cluster node, or a malformed body | ErrorResponse (application/json) |
403 |
The caller lacks the permission the route needs (SEC-019 access gate, auth on: read, write or admin on the collections the request names), or a write meets read-only mode (MDDB_MODE=read or the protocol's own mode). | ErrorResponse (application/json) |
409 |
Refused — another node has a later log, the election was lost, or the node did not catch up | ErrorResponse (application/json) |
403 example (application/json)
{
"error": "forbidden"
}
Step this cluster leader down (admin) #
POST /v1/replication/demote
(v2.19.8, GO-051) The leader stops taking writes and tells the other nodes they may elect a successor; it does not stand again for twice the election timeout.
Authorization: BearerAuth or APIKeyAuth or none
Responses #
| Status | Description | Body |
|---|---|---|
200 |
This node follows | RoleChange (application/json) |
400 |
Not a cluster node | ErrorResponse (application/json) |
403 |
The caller lacks the permission the route needs (SEC-019 access gate, auth on: read, write or admin on the collections the request names), or a write meets read-only mode (MDDB_MODE=read or the protocol's own mode). | ErrorResponse (application/json) |
409 |
This node does not lead | ErrorResponse (application/json) |
403 example (application/json)
{
"error": "forbidden"
}