Cluster API
Cluster API allows you to retrieve information on your cluster status.
Retrieve cluster status
Retrieve cluster nodes status:
CODE
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.ping | Integer | Time took to send a PING command to this node, in ms. |
_nodes.attached | Boolean | If the node is attached to the cluster. If not, you should run a re-initialize command. |
_nodes.error | String | If an error occurs during a PING, the message is given in this field. |
_nodes.master | Integer | The master number of this node. The lowest number gives you the current master node, otherwise secondaries master. If the value is -1, the node is a slave. |
_nodes.status | String | The status of the node. |
_nodes.stage | String | If the node is initializing, the stage of the initialization. |
_nodes.stage-message | String | A user-friendly text explaining the current status of the node. |
_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. |
Example response
JS
{
"nodes": [
{
"node": "ip-172-31-12-124.eu-west-1.compute.internal",
"ping": 1,
"status":"RUNNING",
"stage":"NONE",
"stage-message":"Running",
"current-progress":-1,
"total-progress":-1
"attached": true,
"error": "",
"master": 0
},
{
"node": "ip-172-31-7-12.eu-west-1.compute.internal",
"ping": 14,
"status":"RUNNING",
"stage":"NONE",
"stage-message":"Running",
"current-progress":-1,
"total-progress":-1
"attached": true,
"error": "",
"master": 1
},
{
"node": "ip-172-31-6-126.eu-west-1.compute.internal",
"ping": 13,
"status":"RUNNING",
"stage":"NONE",
"stage-message":"Running",
"current-progress":-1,
"total-progress":-1
"attached": true,
"error": "",
"master": -1
}
],
"restarting": false,
"primary": true
}
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.
CODE
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
JS
{
"primary": true,
"secondary": false
}
Retrieve all up and down nodes
Retrieve all nodes running and down:
CODE
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
JS
{
"nodesDown": [],
"nodesUp": [
"ip-172-31-33-56.eu-west-1.compute.internal",
"ip-172-31-33-12.eu-west-1.compute.internal"
]
}