Difference between revisions of "Trove/Replication-And-Clustering-With-Nodes"
< Trove
(initial (cassandra)) |
(updated remove node notes and changed to DELETE) |
||
Line 171: | Line 171: | ||
<pre> | <pre> | ||
− | + | DELETE /instances/dfbbd9ca-b5e1-4028-adb7-f78643e17998/node/ff9d680c-fde3-49c6-a84e-76173b6df39d | |
− | |||
− | |||
− | |||
</pre> | </pre> | ||
<br> | <br> | ||
Notes: | Notes: | ||
− | * | + | * "Remove" is specifically referring to http://www.datastax.com/documentation/cassandra/2.0/cassandra/operations/ops_remove_node_t.html |
+ | * Will likely have to add validation that a DELETE will not being the cluster into a bad state. | ||
<br> | <br> | ||
+ | |||
==== Scale Up Nodes ==== | ==== Scale Up Nodes ==== | ||
<br> | <br> |
Revision as of 22:03, 25 April 2014
Contents
Cassandra
Create Instance
Request:
POST /instances { "instance": { "name": "products", "datastore": { "type": "cassandra", "version": "2.0.5" }, "configuration": "b9c8a3f8-7ace-4aea-9908-7b555586d7b6", "flavorRef": "7", "volume": { "size": 1 }, "cluster": { "num_nodes": 3 } } }
Response:
{ "instance": { "status": "BUILD", "id": "dfbbd9ca-b5e1-4028-adb7-f78643e17998", "name": "products", "created": "2014-04-25T20:19:23", "updated": "2014-04-25T20:19:23", "links": [{...}], "datastore": { "type": "cassandra", "version": "2.0.5" }, "configuration": { "id": "b9c8a3f8-7ace-4aea-9908-7b555586d7b6", "links": [{...}], }, "flavor": { "id": "7", "links": [{...}], }, "volume": { "size": 1 }, "cluster": { "num_nodes": 3, "nodes": [ {"id": "416b0b16-ba55-4302-bbd3-ff566032e1c1"}, {"id": "7f52e4f9-3fa6-4238-ac08-1ce15197329a"}, {"id": "ff9d680c-fde3-49c6-a84e-76173b6df39d"} ] } } }
Notes:
- The instance.name now acts as the "cluster name", and in the case of Cassandra, the actual cluster_name.
- cluster.num_nodes indicates how many nodes should be in the initial cluster (required)
- The cluster.nodes[].id are generated uuids
- Cassandra-specific fields that are required to construct the initial cluster (num_tokens, endpoint_snitch, seed ip-list, etc.) are to be determined/calculated based on configuration file values and common-sense.
Show Instance
Request:
GET /instances/dfbbd9ca-b5e1-4028-adb7-f78643e17998
Response:
{ "instance": { "status": "ACTIVE", "id": "dfbbd9ca-b5e1-4028-adb7-f78643e17998", "name": "products", "created": "2014-04-25T20:19:23", "updated": "2014-04-25T20:19:23", "links": [{...}], "datastore": { "type": "cassandra", "version": "2.0.5" }, "configuration": { "id": "b9c8a3f8-7ace-4aea-9908-7b555586d7b6", "links": [{...}], }, "flavor": { "id": "7", "links": [{...}], }, "volume": { "size": 1 }, "cluster": { "num_nodes": 3, "nodes": [ {"id": "416b0b16-ba55-4302-bbd3-ff566032e1c1"}, {"id": "7f52e4f9-3fa6-4238-ac08-1ce15197329a"}, {"id": "ff9d680c-fde3-49c6-a84e-76173b6df39d"} ] } } }
Notes:
- Change: instance.volume.used, instance.ip[], and instance.hostname will never be returned
- It's possible that instance.ip[] can remain if it only returns the seed ips.
- It's possible that instance.hostname can remain if it's converted to an array and only contains the seed hostnames.
- Change: the semantic meaning of instance.status, and the possible states, will change
Show Node
Request:
GET /instances/dfbbd9ca-b5e1-4028-adb7-f78643e17998/node/416b0b16-ba55-4302-bbd3-ff566032e1c1
Response:
{ "node": { "status": "ACTIVE", "id": "416b0b16-ba55-4302-bbd3-ff566032e1c1", "name": "products-1", "created": "2014-04-25T20:19:23", "updated": "2014-04-25T20:19:23", "links": [{...}], "ip": ["10.0.0.1"], "volume": { "size": 2, "used": 0.17 } } }
Notes:
- node.name is the instance.name with "-<num>" as a suffix (counter for the cluster, starting at 1)
- the node.status will likely mirror the state values and transitions seen in instance.status prior to the clustering implementation.
Modify Node
Example: Drain (http://www.datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsDrain.html)
POST /instances/dfbbd9ca-b5e1-4028-adb7-f78643e17998/node/416b0b16-ba55-4302-bbd3-ff566032e1c1/action { "drain": {} }
Remove Node
Request:
DELETE /instances/dfbbd9ca-b5e1-4028-adb7-f78643e17998/node/ff9d680c-fde3-49c6-a84e-76173b6df39d
Notes:
- "Remove" is specifically referring to http://www.datastax.com/documentation/cassandra/2.0/cassandra/operations/ops_remove_node_t.html
- Will likely have to add validation that a DELETE will not being the cluster into a bad state.
Scale Up Nodes
Request:
POST /instances/dfbbd9ca-b5e1-4028-adb7-f78643e17998/action { "resize_cluster": { "num_nodes": 6 } }
Response:
HTTP 202 (Empty Body)