The requested URL was not found on this server. 不管你信不信,反正我是没找到

reroute命令报错

Elasticsearch | 作者 hezhiqiang | 发布于2018年11月12日 | 阅读数:7287

我执行下面的命令报错:
POST /_cluster/reroute
{
  "commands" : [ {
    "allocate" : {
    "index" : "kid_book_v3",
    "shard" : 0,
    "node" : "mDHDv4jaRpmD515eIqnJ8g",
    "allow_primary" : true
    }
  }]
}
 
报错内容:
{
  "error": {
    "root_cause": [
      {
        "type": "unknown_named_object_exception",
        "reason": "Unknown AllocationCommand [allocate]",
        "line": 3,
        "col": 18
      }
    ],
    "type": "parsing_exception",
    "reason": "[cluster_reroute] failed to parse field [commands]",
    "line": 3,
    "col": 18,
    "caused_by": {
      "type": "unknown_named_object_exception",
      "reason": "Unknown AllocationCommand [allocate]",
      "line": 3,
      "col": 18
    }
  },
  "status": 400
}
已邀请:

zqc0512 - andy zhou

赞同来自:

"node" : "mDHDv4jaRpmD515eIqnJ8g",
这个名称好像不是用这个吧。
 

dllbdxx

赞同来自:

{
  "commands": [
    {
      "allocate_empty_primary": {
        "index": "你的索引名",
        "shard": "分片号",
        "node": "节点名",
"accept_data_loss":true
      }
    }
  ]
}
或者

{
"commands": [{
"allocate_stale_primary": {
"index": "你的索引",
"shard": 0,
"node": "节点名",
"accept_data_loss": true
}
}]
}

要回复问题请先登录注册