一、全集群重启步骤
1. 禁用分片分配
在关闭数据节点前,需禁用副本分片的分配,避免不必要的 I/O 操作。通过以下命令将分片分配限制为仅主分片:
resp = client.cluster.put_settings(
persistent={
"cluster.routing.allocation.enable": "primaries"
}
)
print(resp)
response = client.cluster.put_settings(
body: {
persistent: {
'cluster.routing.allocation.enable' => 'primaries'
}
}
)
puts response
const response = await client.cluster.putSettings({
persistent: {
"cluster.routing.allocation.enable": "primarie