Admin API
Note that all Admin API endpoints in this document listen on Metasrv's HTTP_PORT, which defaults to 4000.
The Admin API exposes Metasrv status, cluster controls, and metadata recovery operations over HTTP. It does not provide authentication, and some endpoints change cluster behavior or metadata allocation. Deployments must protect the HTTP port with network-level controls. This page covers the following APIs:
- /health
- /leader
- /heartbeat
- /node-lease
- /maintenance
- /procedure-manager
- /recovery
- /sequence/table
All these APIs are under the parent resource /admin.
In the following sections, we assume that your metasrv instance is running on localhost port 4000.
/health HTTP endpoint
The /health endpoint accepts GET requests and returns OK when the HTTP service is running. It does not check whether this Metasrv is the leader or whether external dependencies are available.
Definition
curl -X GET http://localhost:4000/admin/health
Examples
Request
curl -X GET http://localhost:4000/admin/health
Response
OK
/leader HTTP endpoint
The /leader endpoint accepts GET HTTP requests and you can use this endpoint to query the leader's addr of your metasrv instance.
Definition
curl -X GET http://localhost:4000/admin/leader
Examples
Request
curl -X GET http://localhost:4000/admin/leader
Response
127.0.0.1:4000
/heartbeat HTTP endpoint
The /heartbeat endpoint accepts GET HTTP requests and you can use this endpoint to query the heartbeat of all datanodes.
You can also query the heartbeat data of the datanode for a specified addr, however, specifying addr in the path is optional.
Definition
curl -X GET http://localhost:4000/admin/heartbeat
| Query String Parameter | Type | Optional/Required | Definition |
|---|---|---|---|
| addr | String | Optional | The addr of the datanode. |
Examples
Request
curl -X GET 'http://localhost:4000/admin/heartbeat?addr=127.0.0.1:4100'
Response
[
[
{
"timestamp_millis": 1677049348651,
"id": 1,
"addr": "127.0.0.1:4100",
"rcus": 0,
"wcus": 0,
"region_num": 2,
"region_stats": [],
"topic_stats": [],
"node_epoch": 0,
"datanode_workloads": {
"types": []
},
"gc_stat": null
}
]
]
/node-lease HTTP endpoint
The /node-lease endpoint returns the current leases recorded for Datanodes. Use it when diagnosing whether Metasrv still considers a Datanode active.
curl -X GET http://localhost:4000/admin/node-lease
/maintenance HTTP endpoint
Maintenance mode temporarily disables automatic cluster management operations during upgrades, planned downtime, or similar work. See Cluster Maintenance Mode for its effect on the cluster.
The /maintenance endpoint supports the following HTTP requests:
GET /admin/maintenanceorGET /admin/maintenance/status: query the maintenance mode status.POST /admin/maintenance/enable: enable maintenance mode.POST /admin/maintenance/disable: disable maintenance mode.
The response body uses the following format:
{
"enabled": true
}
/procedure-manager HTTP endpoint
This endpoint is used to manage the Procedure Manager status. For more details, please refer to Prevent Metadata Changes.
The /procedure-manager endpoint supports the following HTTP requests:
GET /admin/procedure-manager/status: query the Procedure Manager status.POST /admin/procedure-manager/pause: pause the Procedure Manager.POST /admin/procedure-manager/resume: resume the Procedure Manager.
The response body uses the following format:
{
"status": "running"
}