0
0
Elasticsearchquery~10 mins

Shard allocation awareness in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable shard allocation awareness for the attribute 'rack'.

Elasticsearch
PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.awareness.attributes": "[1]"
  }
}
Drag options to blanks, or click blank then click option'
Arack
Bzone
Cnode
Dhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using an attribute name that is not configured on nodes.
Setting the attribute under 'persistent' instead of 'transient' when testing.
2fill in blank
medium

Complete the code to set the awareness forced value to 'rack1' for shard allocation.

Elasticsearch
PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.awareness.force.rack": "[1]"
  }
}
Drag options to blanks, or click blank then click option'
Ahost1
Bzone1
Crack1
Dnode1
Attempts:
3 left
💡 Hint
Common Mistakes
Using an attribute value that does not exist on any node.
Confusing the attribute name with the attribute value.
3fill in blank
hard

Fix the error in the code to correctly configure shard allocation awareness for 'zone'.

Elasticsearch
PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.awareness.attributes": "[1]"
  }
}
Drag options to blanks, or click blank then click option'
A[zone]
B"zone"
C'zone'
Dzone
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes instead of double quotes.
Not quoting the string at all.
Using brackets which are invalid here.
4fill in blank
hard

Fill both blanks to create a dictionary that sets awareness attributes and forces allocation to 'zone1'.

Elasticsearch
PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.awareness.attributes": "[1]",
    "cluster.routing.allocation.awareness.force.[2]": "zone1"
  }
}
Drag options to blanks, or click blank then click option'
Azone
Brack
Dhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using different attribute names for the two settings.
Misspelling the attribute name.
5fill in blank
hard

Fill all three blanks to create a shard allocation awareness setting that uses 'rack' attribute, forces allocation to 'rack2', and sets a custom attribute.

Elasticsearch
PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.awareness.attributes": "[1]",
    "cluster.routing.allocation.awareness.force.[2]": "[3]"
  }
}
Drag options to blanks, or click blank then click option'
Arack
Crack2
Dzone
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching attribute names.
Using an invalid forced value.