群集中未分配的碎片

时间:2014-10-10 21:02:31

标签: elasticsearch sharding

我有一个正在播放的ES群集。有一次,我将所有主要和副本分片正确分配给我的5个节点中的4个,但是在尝试将某些分区放到第5个节点上时,我再次丢失了我的副本分片。现在我的主分片仅存在于3个节点上。

我正试图找到问题的根源:

尝试强制分配,例如:

{
  "commands": [
    {
      "allocate": {
        "index": "group7to11poc",
        "shard": 7,
        "node": "SPOCNODE1"
      }
    }
  ]
}

我收到以下回复。我无法找到确切的问题!

explanations: [1]
  0:  {
    command: "allocate"
    parameters: {
    index: "group7to11poc"
    shard: 7
    node: "SPOCNODE5"
    allow_primary: true
  }-
decisions: [11]
  0:  {
    decider: "same_shard"
    decision: "YES"
    explanation: "shard is not allocated to same node or host"
  }-
  1:  {
    decider: "filter"
    decision: "NO"
    explanation: "node does not match index include filters [_id:"4rZYPBOGRMK4y9YG6p7E2w"]"
  }-
  2:  {
    decider: "replica_after_primary_active"
    decision: "YES"
    explanation: "primary is already active"
  }-
  3:  {
    decider: "throttling"
    decision: "YES"
    explanation: "below shard recovery limit of [2]"
  }-
  4:  {
    decider: "enable"
    decision: "YES"
    explanation: "allocation disabling is ignored"
  }-
  5:  {
    decider: "disable"
    decision: "YES"
    explanation: "allocation disabling is ignored"
  }-
  6:  {
    decider: "awareness"
    decision: "YES"
    explanation: "no allocation awareness enabled"
  }-
  7:  {
    decider: "shards_limit"
    decision: "YES"
    explanation: "total shard limit disabled: [-1] <= 0"
  }-
  8:  {
    decider: "node_version"
    decision: "YES"
    explanation: "target node version [1.3.2] is same or newer than source node version [1.3.2]"
  }-
  9:  {
    decider: "disk_threshold"
    decision: "YES"
    explanation: "disk usages unavailable"
  }-
  10:  {
    decider: "snapshot_in_progress"
    decision: "YES"
    explanation: "shard not primary or relocation disabled"
  }-

1 个答案:

答案 0 :(得分:1)

最后排序了这个。不知何故,索引已经应用了一个过滤器,阻止了分片和移动。

我删除了过滤器,群集开始表现。

  

curl -XPUT localhost:9200 / test / _settings -d'{       “index.routing.allocation.include._id”:“”}''

这会将_id过滤器设置为空。这是先前填充的,并阻止过滤器匹配!