
1、超过磁盘水位线设置,85%,90%,95%
85%:新分片不再分配到节点。
90%:移动一部分分片到其它节点。
95%:索引被标识为只读。
检查方法:
GET /_cat/nodes?v
GET /_cat/allocation?v
解决方案:
1、取消部分索引的副本分片。
2、移动分片重新分配分片。
3、临时调整水位
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.disk.watermark.low": "85%",
"cluster.routing.allocation.disk.watermark.high": "90%",
"cluster.routing.allocation.disk.watermark.flood_stage": "95%"
}
}3、每个节点最大数设置
GET /_cluster/settings?include_defaults&flat_settings
PUT /_cluster/settings
{
"transient": {
"cluster.max_shards_per_node":"1200"
}
}GET _cat/indices?v&health=yellow
GET _cat/shards/tms_waybill_xxx?v
PUT _cluster/settings
{
"transient": {
"cluster.routing.allocation.enable":"all"
}
}
GET _cluster/allocation/explain?pretty修复分片
POST _cluster/reroute?retry_failed=true
GET /_cat/indices?v&health=red
GET /_cat/shards?v&h=n,index,shard,prirep,state,sto,sc,unassigned.reason,unassigned.details&s=sto,index
GET /_cluster/allocation/explain
{
"index":"crm_express_month_201901",
"shard":"1",
"primary":true
}
POST /_cluster/reroute
{
"commands": [
{
"move": {
"index": "test", "shard": 0,
"from_node": "node1", "to_node": "node2"
}
},
{
"allocate_replica": {
"index": "test", "shard": 1,
"node": "node3"
}
},
{
"allocate_stale_primary": {
"index": "<index_name>",
"shard": <shard_id>,
"node": "<node_name>",
"accept_data_loss": true
}
}
]
}
POST localhost:9200/twitter/_close?pretty
{
"acknowledged": true
}
POST localhost:9200/twitter/_open?pretty
{
"acknowledged": true,
"shards_acknowledged": true
}原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。