定位到未分配的索引
代码语言:txt
复制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
方案一
代码语言:txt
复制修复分片
POST _cluster/reroute?retry_failed=true
分配陈腐的分片
POST _cluster/reroute?pretty" -d '
{
"commands": [
{
"allocate_stale_primary": {
"index": "{索引名称}",
"shard": "{分片ID}",
"node": "{节点名称}",
"accept_data_loss": true
}
}
]
}
POST "localhost:9200/_cluster/reroute?pretty" -d '
{
"commands" : [
{
"allocate_empty_primary" : {
"index" : "{索引名称}",
"shard" : "{分片ID}",
"node" : "{节点名称}",
"accept_data_loss": true
}
}
]
}'
POST localhost:9200/twitter/_close?pretty
{
"acknowledged": true
}
POST localhost:9200/twitter/_open?pretty
{
"acknowledged": true,
"shards_acknowledged": true
}