Cluster API
Cluster API allows you to retrieve information on your cluster status.
Retrieve cluster status
Retrieve cluster nodes status:
GET /api/monitor/status
JSON Format
Name | Type | Description |
---|---|---|
restarting | Boolean | true if the cluster is restarting. |
primary | Boolean | true if the current node is a primary master node. |
nodes.node | String | IP address of the node. |
nodes.node-id | Integer | Integer identifying the node |
nodes.state | String | Status of the node (see Cluster/Node Status) |
nodes.state-message | String | Description of the state |
nodes.role | String | Current role of the node in the cluster (Primary or Secondary) |
nodes.serving | Boolean | True if state is Serving |
nodes.attached | Boolean | True if the node is attached to the cluster |
nodes.current-progress | String | If the node is loading the warehouse, the number of tables that have been loaded so far. |
nodes.total-progress | String | If the node is loading the warehouse, the total number of remaining tables to load. |
nodes.error | Boolean | True if the node is in error state |
nodes.error-message | String | Description of the error |
nodes.primary | Boolean | True if the node is the primary master |
nodes.outdated-status | Boolean | True if the status of this node is outdated (the node didn't send a status update since more than 5sec). |
Example response
{
"nodes": [
{
"node": "172.18.0.3:19999",
"node-id": -1,
"state": "BOOTSTRAP",
"state-message": "Starting",
"role": "Secondary Master -1",
"serving": false,
"attached": false,
"current-progress": -1,
"total-progress": -1,
"error": false,
"error-message": "",
"primary": false,
"outdated-status": false
},
{
"node": "172.18.0.4:19999",
"node-id": 0,
"state": "SERVE",
"state-message": "Serving",
"role": "Primary Master",
"serving": true,
"attached": true,
"current-progress": -1,
"total-progress": -1,
"error": false,
"error-message": "",
"primary": true,
"outdated-status": false
},
{
"node": "172.18.0.5:19999",
"node-id": 1,
"state": "SERVE",
"state-message": "Serving",
"role": "Secondary Master 1",
"serving": true,
"attached": true,
"current-progress": -1,
"total-progress": -1,
"error": false,
"error-message": "",
"primary": false,
"outdated-status": false
}
],
"restarting": false,
"primary": false
}
Please note the outdated-status
field: if this field is true, it means the status has not been updated by the node since more than 5sec. It's likely that this node is down, or can't communicate with the rest of the cluster.
Is Current node a primary master
When high availability is enabled, this endpoint tells you if you're querying the primary or a secondary master.
GET /api/monitor/get/master
JSON Format
Name | Type | Description |
---|---|---|
primary | Boolean | true if this monitor is running on a primary node |
secondary | Boolean | true if this monitor is running on a secondary node |
Example response
{
"primary": true,
"secondary": false
}
Retrieve all up and down nodes
Retrieve all nodes running and down:
GET /api/monitor/get/nodes
JSON Format
Name | Type | Description |
---|---|---|
nodesDown | Array | List of all nodes down or unattached |
nodesUp | Array | List of all nodes up and running |
Response example
{
"nodesDown": [],
"nodesUp": [
"ip-172-31-33-56.eu-west-1.compute.internal",
"ip-172-31-33-12.eu-west-1.compute.internal"
]
}