# NOT RUN {
# connection setup
(x <- connect())
cluster_settings(x)
cluster_health(x)
cluster_state(x)
cluster_state(x, metrics = "version")
cluster_state(x, metrics = "nodes")
cluster_state(x, metrics = c("version", "nodes"))
cluster_state(x, metrics = c("version", "nodes", 'blocks'))
cluster_state(x, "shakespeare", metrics = "metadata")
cluster_state(x, c("shakespeare", "flights"), metrics = "metadata")
cluster_stats(x)
cluster_pending_tasks(x)
body <- '{
"commands": [
{
"move": {
"index" : "test", "shard" : 0,
"from_node" : "node1", "to_node" : "node2"
}
},
{
"allocate_replica" : {
"index" : "test", "shard" : 1, "node" : "node3"
}
}
]
}'
# cluster_reroute(x, body = body)
cluster_health(x)
# cluster_health(x, wait_for_status = "yellow", timeout = "3s")
# }
Run the code above in your browser using DataLab