Cluster operations include initiating administrative actions on nodes, such as garbage collection, in a Cassandra or DSE cluster, rebalancing a cluster, and managing API requests sent to cluster.
Initiate JVM garbage collection on a Node.
| Path arguments: |
|
|---|
Returns null.
Example:
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/gc/1.2.3.4
Assign a new token to the node.
| Path arguments: |
|
|---|---|
| Body : | New token to assign to node. |
Returns a Request ID.
Example:
curl -X PUT
http://127.0.0.1:8888/Test_Cluster/ops/move/10.11.12.72
-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 -X PUT
http://127.0.0.1:8888/Test_Cluster/ops/drain/1.2.3.4
Initiate decommissioning of a node.
| Path arguments: |
|
|---|
Returns null.
Example:
curl -X PUT
http://127.0.0.1:8888/Test_Cluster/ops/decommission/1.2.3.4
Perform a removetoken operation on the given node.
| Path arguments: |
|
|---|---|
| Body : | A JSON dictionary with one optional key, force, which accepts a boolean value. force may only be set to true when a removetoken operation is already in progress for the given node. |
Returns a Request ID.
Example:
curl -X PUT
http://127.0.0.1:8888/Test_Cluster/ops/removetoken/1.2.3.4
-d '{"force": true}'
Assassinates a node.
| Path arguments: |
|
|---|
Returns a Request ID.
Example:
curl -X PUT
http://127.0.0.1:8888/Test_Cluster/ops/assassinate/1.2.3.4
Initiate a cleanup operation for the specified keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to cleanup. If empty, all column families will be cleaned up. |
Returns null.
Example
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/cleanup/1.2.3.4/Keyspace1
-d '["ColFam1", "ColFam2"]'
Flush memtables for a keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to flush. If empty, all column families will be flushed. |
Returns null.
Example
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/flush/1.2.3.4/Keyspace1
-d '["ColFam1", "ColFam2"]'
Initiates repair of a keyspace.
| Path arguments: |
|
|---|---|
| Body : | A JSON dictionary with three keys:
|
Returns null.
Example
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/repair/1.2.3.4/Keyspace1
-d '["ColFam1", "ColFam2"]'
Initiates a major compaction on a keyspace.
| Path arguments: |
|
|---|---|
| Body : | List of column families to compact. If this is empty, all column families will be compacted. |
Returns null.
Example
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/compact/1.2.3.4/Keyspace1
-d '["ColFam1", "ColFam2"]'
Start the Cassandra/DSE process on a single node.
| Path arguments: |
|
|---|
Returns a Request ID.
Example:
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/start/10.11.12.72
Output:
"a34814a6-4896-11e2-a563-e0b9a54a6d93"
Stop the Cassandra/DSE process on a single node.
| Path arguments: |
|
|---|
Returns a Request ID.
Example:
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/stop/10.11.12.72
Output:
"c0d81d54-4896-11e2-a563-e0b9a54a6d93"
Restart the Cassandra/DSE process on a single node.
| Path arguments: |
|
|---|
Returns a Request ID.
Example:
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/restart/10.11.12.72
Output:
"e2212500-4896-11e2-a563-e0b9a54a6d93"
Perform a rolling restart of the entire cluster or a select list of nodes.
| Path arguments: |
|
|---|---|
| Body : | A JSON dictionary with two optional keys:
|
Returns a Request ID.
Example:
curl -X POST
http://127.0.0.1:8888/Test_Cluster/ops/restart/10.11.12.72
Output:
"e2212500-4896-11e2-a563-e0b9a54a6d93"
Return a list of proposed moves to run to balance a cluster. Will throw an error if called on a cluster using vnodes
| Path arguments: | cluster_id -- A Cluster Config ID. |
|---|
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
Output:
[
[
"85070591730234615865843651857942052864",
"10.11.12.152"
]
]
Run the specified list of moves to balance a cluster. Will throw an error if called on a cluster using vnodes
| Path arguments: | cluster_id -- A Cluster Config ID. |
|---|---|
| Opt. 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 -X POST
http://127.0.0.1:8888/Test_Cluster/ops/rebalance
-d
'[
[
"85070591730234615865843651857942052864",
"10.11.12.152"
]
]'
Output:
"e330b179-1b9f-40c2-a2f5-d2f3d24aa85c"
Requests are the method that OpsCenter uses to track potentially long-running requests that must be completed asynchronously. When these potentially long-running API calls are made, opscenterd will immediately return a Request ID that can be used to look up the status of the request.
Once a Request is started, you can fetch the status information for it until opscenterd is restarted or a large number of Requests have been started.
A Request status takes the following form:
{
"id": ID,
"state": STATE,
"started": STARTED,
"finished": FINISHED,
"cluster_id": CLUSTER_ID,
"details": DETAILS
}
| Data: |
|
|---|---|
| Content Types: |
|
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
{
"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. Not all requests can be cancelled.
| Path arguments: |
|
|---|
Returns null.
Example
curl -X POST
http://127.0.0.1:8888/Test_Cluster/request/6b6b15aa-df8a-43f1-aab3-efce6b8589e4/cancel
The request is canceled.