Complete the code to start a rolling upgrade by setting the cluster to read-only mode.
PUT /_cluster/settings
{
"persistent": {
"cluster.blocks.read_only": [1]
}
}Setting cluster.blocks.read_only to true makes the cluster read-only, which is a common step before starting a rolling upgrade.
Complete the code to update the index settings to disable replicas during the rolling upgrade.
PUT /my-index/_settings
{
"index": {
"number_of_replicas": [1]
}
}Setting number_of_replicas to 0 disables replicas, which helps reduce overhead during rolling upgrades.
Fix the error in the code to check the cluster health status during the rolling upgrade.
GET /_cluster/health
{
"wait_for_status": [1]
}The wait_for_status parameter requires a string value like "green" or "yellow" enclosed in quotes.
Fill both blanks to update the cluster settings to disable shard allocation and then re-enable it after the upgrade.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.enable": [1]
}
}
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.enable": [2]
}
}Setting cluster.routing.allocation.enable to "none" disables shard allocation during upgrade, and setting it back to "all" re-enables it.
Fill all three blanks to create a script that disables shard allocation, waits for green status, and then re-enables allocation.
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.enable": [1]
}
}
GET /_cluster/health
{
"wait_for_status": [2],
"timeout": "30s"
}
PUT /_cluster/settings
{
"transient": {
"cluster.routing.allocation.enable": [3]
}
}This script disables shard allocation with "none", waits for the cluster to reach "green" status, then re-enables allocation with "all".