Skip to content

Instantly share code, notes, and snippets.

@miladjahandideh
Last active November 27, 2023 13:35
Show Gist options
  • Save miladjahandideh/7a4dc5a96d8576d162204eaea786a76d to your computer and use it in GitHub Desktop.
Save miladjahandideh/7a4dc5a96d8576d162204eaea786a76d to your computer and use it in GitHub Desktop.
OpenSearch HOST MAINTENANCE
GET _cluster/health
GET _cat/nodes
GET _cluster/settings
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
# Now, when you take down a node, OpenSearch won't try to allocate shard from that node to other nodes and you can perform you maintenance activity and then once the node is up, you can enable shard allocation again
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "all"
}
}
GET _cluster/health
GET _cat/nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment