Cluster Admin Flashcards
How do you check the status of the nodes?
GET _cat/nodes?v
How do you check the status of indices?
GET _cat/indices/v
How do you see on which nodes the shards of an index is allocated?
GET _cat/shards/< index >?v
How does elastic determine in which nodes to put shards?
Elastic will make its best judment based on the settings of the index, unless you do allocation filtering.
How do you specify the number of replicas and shards of an index?
In the index settings:
PUTS < index > { settings: { number_of_replicas: X, number_of_shards: Y. } }
What’s a shortcut to modify only the index settings?
PUT < index >/_settings
How to override index routing allocation (filtering)?
IN the index settings:
# To exclude a node { "index.routing.allocation.exclude._name": "< node name >, ...." }
# To revert the exclusion: { "index.routing.allocation.exclude._name": null }
TODO: Check the api doc to other variables and use cases.
What are some fail safe measurement elastic has in place for shard allocation?
Elastic will only reallocate the shards if the index will remain in a green state.
How to do cluster routing allocation?
PUT _cluster/settings
{
“transient”: {
“cluster.routing.allocation.exclude._name”: “< node name >, …”
What is transient and persistent cluster settings?
Transient won’t survive a cluster restart.
What is routing allocation in elastic and what are some of the use cases?
Allows you to manually create rules that dictate where shards are allocated.
A common use case is taking a node down from the cluster, so you can filter that single node, wait for the cluster to rebalance and then shut it down.
How do you see the node attributes?
GET _cat/nodeattrs?v
What is cluster routing allocation awareness and what are some of the use cases?
Allows to create some allocation rules for where to put primaries/replicas.
A tipical use case is avoiding putting all data into a single zone. So you can create “zone” custom attribute and use that in the allocation.
What are the 2 ways to setup rounting allocation affinity?
Either put in the config.yml or use the API.
How do you setup cluster routing awareness?
PUT _cluster/settings { "persistent": { "cluster.routing.allocation.awareness.attributes": "< attr name >" }