Cluster operations include initiating administrative actions on nodes, such as garbage compaction, in a Cassandra or DSE cluster, rebalancing a cluster, and managing API requests sent to cluster.
| Node Administration Methods | URL |
|---|---|
| Initiate Java garbage compaction on a node. | GET /{cluster_id}/ops/gc/{node_ip} |
| Assign a new token to the node. | PUT /{cluster_id}/ops/move/{node_ip} |
| Flush all memtables from the node. | GET /{cluster_id}/ops/drain/{node_ip} |
| Decommission a node. | GET /{cluster_id}/ops/decommission/{node_ip} |
| Clean up a keyspace. | POST /{cluster_id}/ops/cleanup/{node_ip}/{ks_name} |
| Flush memtables from a keyspace. | POST /{cluster_id}/ops/flush/{node_ip}/{ks_name} |
| Repair a keyspace. | POST /{cluster_id}/ops/repair/{node_ip}/{ks_name} |
| Perform compaction on a keyspace. | POST /{cluster_id}/ops/compact/{node_ip}/{ks_name} |
Ensure that each node in a Cassandra cluster is managing an equal amount of data using these methods.
| Cluster Rebalancing Methods | URL |
|---|---|
| List moves to balance a cluster. | GET /{cluster_id}/ops/rebalance |
| Run a list of moves to balance a cluster. | POST /{cluster_id}/ops/rebalance |
Determine the status of Real-time Query operations in Cassandra using these methods.
| Request Management Methods | URL |
|---|---|
| Get the status of the request. | GET /{cluster_id}/request/{request_id}/status |
| Cancel a request. | POST /{cluster_id}/request/{request_id}/cancel |
Initiate Java garbage compaction on a Node.
| Path arguments: |
|
|---|
Returns null.
Example:
curl
http://127.0.0.1:8888/Test_Cluster/ops/gc/1.2.3.4
-X GET
Assign a new token to the node.
| Path arguments: |
|
|---|---|
| Body : | New token to assign to node |
Returns a Request ID, the ID returned by the API call that triggered the request.
Example:
curl
http://127.0.0.1:8888/Test_Cluster/ops/move/10.11.12.72
-X PUT
-d '"85070591730234615865843651857942052864"'
Output:
"72ff69b2-9cf5-4777-a600-9173b3fe7e6a"
Initiate a drain operation to flush all memtables from the node.
| Path arguments: |
|
|---|
Returns null.
Example:
curl
http://127.0.0.1:8888/Test_Cluster/ops/drain/1.2.3.4
-X GET
Initiate decommissioning of a node.
| Path arguments: |
|
|---|
Returns null.
Example:
curl
http://127.0.0.1:8888/Test_Cluster/ops/decommission/1.2.3.4
-X GET
Initiate a cleanup operation for the specified keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to cleanup. Empty = all column families. |
Returns null.
Example
curl
http://127.0.0.1:8888/Test_Cluster/ops/cleanup/1.2.3.4/Keyspace1
-X POST
-d '["ColFam1", "ColFam2"]'
Flush memtables for a keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to flush. Empty = all column families. |
Returns null.
Example
curl
http://127.0.0.1:8888/Test_Cluster/ops/flush/1.2.3.4/Keyspace1
-X POST
-d '["ColFam1", "ColFam2"]'
Initiates repair of a keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to repair. Empty = all column families. |
Returns null.
Example
curl
http://127.0.0.1:8888/Test_Cluster/ops/repair/1.2.3.4/Keyspace1
-X POST
-d '["ColFam1", "ColFam2"]'
Initiates a major compaction on a keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to compact. Empty = all column families. |
Returns null.
Example
curl
http://127.0.0.1:8888/Test_Cluster/ops/compact/1.2.3.4/Keyspace1
-X POST
-d '["ColFam1", "ColFam2"]'
Return a list of proposed moves to run to balance a cluster.
| Path arguments: | cluster_id -- A key, which identifies the node's cluster, in the dictionary returned by GET /cluster-configs. |
|---|
Returns a list of moves, where each move is a token and the IP address of its assigned node. The result of this call is passed to POST /{cluster_id}/ops/rebalance.
Example
curl http://127.0.0.1:8888/Test_Cluster/ops/rebalance
-X GET
Output:
[
[
"85070591730234615865843651857942052864",
"10.11.12.152"
]
]
Run the specified list of moves to balance a cluster.
| Path arguments: | cluster_id -- A key, which identifies the node's cluster, in the dictionary returned by GET /cluster-configs. |
|---|---|
| Query params: | sleep -- An optional number of seconds to wait between each move. |
| Body : | A list of moves to run to balance this cluster. This is typically the result of GET /{cluster_id}/ops/rebalance. |
Returns a Request ID for determining the status of, or cancelling, a running rebalance.
Example
curl http://127.0.0.1:8888/Test_Cluster/ops/rebalance
-X POST
-d
'[[
"85070591730234615865843651857942052864",
"10.11.12.152"
]]'
Output:
"e330b179-1b9f-40c2-a2f5-d2f3d24aa85c"
Check the status of an asynchronous request sent to OpsCenter.
| Path arguments: |
|
|---|
Return a dictionary describing the status of the request.
Example
curl http://127.0.0.1:8888/Test_Cluster/request
/6b6b15aa-df8a-43f1-aab3-efce6b8589e4/status
-X GET
{
"status": "running",
"started": 1334856122,
"error_message": null,
"finished": null,
"moves": [
{
"status": null,
"ip": "10.100.100.100",
"old": "2",
"new": "85070591730234615865843651857942052864"
}
],
"id": "6b6b15aa-df8a-43f1-aab3-efce6b8589e4"
}
Cancel an asynchronous request sent to OpsCenter.
| Path arguments: |
|
|---|
Returns null.
Example
curl http://127.0.0.1:8888/Test_Cluster/
request/6b6b15aa-df8a-43f1-aab3-efce6b8589e4/cancel
-X POST
The request is canceled.