Complete the code to enable shard allocation awareness for the attribute 'rack'.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.awareness.attributes": "[1]"
}
}The setting cluster.routing.allocation.awareness.attributes should be set to the attribute name you want to use for shard allocation awareness, such as rack.
Complete the code to set the awareness forced value to 'rack1' for shard allocation.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.awareness.force.rack": "[1]"
}
}The forced awareness value should match the attribute value you want to prioritize, such as rack1.
Fix the error in the code to correctly configure shard allocation awareness for 'zone'.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.awareness.attributes": "[1]"
}
}The attribute value must be a string enclosed in double quotes in JSON, like "zone".
Fill both blanks to create a dictionary that sets awareness attributes and forces allocation to 'zone1'.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.awareness.attributes": "[1]",
"cluster.routing.allocation.awareness.force.[2]": "zone1"
}
}The attribute name must be consistent for both settings. Here, zone is used for awareness attributes and for the forced allocation key.
Fill all three blanks to create a shard allocation awareness setting that uses 'rack' attribute, forces allocation to 'rack2', and sets a custom attribute.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.awareness.attributes": "[1]",
"cluster.routing.allocation.awareness.force.[2]": "[3]"
}
}The attribute name rack is used for awareness and forced allocation, and the forced value is rack2.