前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ES 分片未分配处理

ES 分片未分配处理

原创
作者头像
周银辉
修改2024-09-29 11:00:19
80
修改2024-09-29 11:00:19
举报
文章被收录于专栏:elasticsearch常见问题

定位到未分配的索引

代码语言: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
}

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 定位到未分配的索引
    • 方案一
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档