為什么要移除一個節點,有很多種情況
- 節點所在物理機要銷毀,
- 節點實體需要升級、重啟
es官方本身支持這個操作,官方檔案
實施
step1:
修改cluster.routing.allocation.exclude.{attribute}這個引數{attribute}可以使ip,cluster name,host,這個引數可以使分片避開配置里的所有節點,同時exclude節點里的所有分片(所有index都會涉及)會自動分配到其他節點,
PUT _cluster/settings
{
"transient": {
"cluster.routing.allocation.exclude._ip": "10.10.0.1"
}
}
step2:
清空內容,防止該節點再次加入集群無法自動平衡分片,
PUT _cluster/settings
{
"transient": {
"cluster.routing.allocation.exclude._ip": "null"
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/208667.html
標籤:大數據
