# Зависают шарды после настроек (проблема с настройками индекса)

**URL:** <https://discuss.elastic.co/t/topic/78256>\
**Category:** Elasticsearch\
**Created:** [March 11, 2017, 8:41pm UTC](https://discuss.elastic.co/t/topic/78256 "2017-03-11T20:41:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergei\_Malanin](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sergei\_Malanin](https://discuss.elastic.co/u/Sergei_Malanin)\
**Post date:** [March 11, 2017, 8:41pm UTC](https://discuss.elastic.co/t/topic/78256/1 "2017-03-11T20:41:58Z")

</div>

ES(2.4.4)  
Есть проблема. после настройки индекса и его запуска шарды зависают  
Порядок действий:

Создаю индекс news  
делаю curl -XPOST '[http://127.0.0.1:9200/news/\_close/](http://127.0.0.1:9200/news/_close/)  
далее curl -XPUT '[http://127.0.0.1:9200/news/\_settings/](http://127.0.0.1:9200/news/_settings/) -d  
`{ "settings": { "analysis": { "char_filter": { "ru": { "type": "mapping", "mappings": ["Ё=>Е", "ё=>е"] } }, "filter:": { "russian_stop": { "type": "stop", "stopwords": ["а", "без", "более", "бы", "был", "была", "были", "было", "быть", "в", "вам", "вас", "весь", "во", "вот", "все", "всего", "всех", "вы", "где", "да", "даже", "для", "до", "его", "ее", "если", "есть", "еще", "же", "за", "здесь", "и", "из", "или", "им", "их", "к", "как", "ко", "когда", "кто", "ли", "либо", "мне", "может", "мы", "на", "надо", "наш", "не", "него", "нее", "нет", "ни", "них", "но", "ну", "о", "об", "однако", "он", "она", "они", "оно", "от", "очень", "по", "под", "при", "с", "со", "так", "также", "такой", "там", "те", "тем", "то", "того", "тоже", "той", "только", "том", "ты", "у", "уже", "хотя", "чего", "чей", "чем", "что", "чтобы", "чье", "чья", "эта", "эти", "это", "я"], "ignore_case": "true" }, "custom_stop": { "type": "stop", "stopwords": ["n", "r"] }, "custom_word_delimiter": { "type": "word_delimiter", "generate_word_parts": "false", "generate_number_parts": "true", "catenate_words": "true", "catenate_numbers": "false", "catenate_all": "true", "split_on_case_change": "false", "preserve_original": "true", "split_on_numerics": "false" } }, "analyzer": { "russian_analyzer": { "type": "custom", "char_filter": ["html_strip", "ru"], "tokenizer": "standard", "filter": ["stop", "custom_stop", "russian_stop", "custom_word_delimiter", "lowercase", "russian_morphology", "english_morphology"] } } } } }`

потом curl -XPOST 'http:/127.0.0.1:9200/'$1'/\_open

---

<div class="post-metadata">

**Author:** ![Sergei\_Malanin](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sergei\_Malanin](https://discuss.elastic.co/u/Sergei_Malanin)\
**Post date:** [March 11, 2017, 8:44pm UTC](https://discuss.elastic.co/t/topic/78256/2 "2017-03-11T20:44:15Z")

</div>

после этого процессор загружается почти на 100 %  
[http://127.0.0.1:9200/\_cat/shards?v](http://127.0.0.1:9200/_cat/shards?v) выдает следующее  
`index shard prirep state docs store ip node news 2 p INITIALIZING 172.17.0.3 Hardshell news 2 r UNASSIGNED news 4 p INITIALIZING 172.17.0.3 Hardshell news 4 r UNASSIGNED news 1 p UNASSIGNED news 1 r UNASSIGNED news 3 p INITIALIZING 172.17.0.3 Hardshell news 3 r UNASSIGNED news 0 p INITIALIZING 172.17.0.3 Hardshell news 0 r UNASSIGNED .kibana 0 p STARTED 1 3.1kb 172.17.0.3 Hardshell .kibana 0 r UNASSIGNED`

---

<div class="post-metadata">

**Author:** ![Sergei\_Malanin](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sergei\_Malanin](https://discuss.elastic.co/u/Sergei_Malanin)\
**Post date:** [March 11, 2017, 8:46pm UTC](https://discuss.elastic.co/t/topic/78256/3 "2017-03-11T20:46:19Z")

</div>

\_cluster/reroute  
`{ "commands": [{ "allocate": { "index": "news", "shard": 2, "node": "Hardshell", "allow_primary": "true" } }] }`

+++++++++++++  
выдает вот такое

---

<div class="post-metadata">

**Author:** ![Sergei\_Malanin](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sergei\_Malanin](https://discuss.elastic.co/u/Sergei_Malanin)\
**Post date:** [March 11, 2017, 8:46pm UTC](https://discuss.elastic.co/t/topic/78256/4 "2017-03-11T20:46:55Z")

</div>

```
`{

```

"acknowledged": true,  
"state": {  
"version": 82140,  
"state\_uuid": "-jOgAb-PTy6Gus-Px\_jz8A",  
"master\_node": "1CKLV2W4TS6jP0BIuFctPQ",  
"blocks": {

```
},
"nodes": {
  "1CKLV2W4TS6jP0BIuFctPQ": {
    "name": "Hardshell",
    "transport_address": "172.17.0.3:9300",
    "attributes": {

    }
  }
},
"routing_table": {
  "indices": {
    "news": {
      "shards": {
        "0": [
          {
            "state": "UNASSIGNED",
            "primary": true,
            "node": null,
            "relocating_node": null,
            "shard": 0,
            "index": "news",
            "version": 801,
            "unassigned_info": {
              "reason": "ALLOCATION_FAILED",
              "at": "2017-03-11T20:27:42.607Z",
              "details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian_analyzer] failed to find filter under name [custom_stop]]; "
            }
          },
          {
            "state": "UNASSIGNED",
            "primary": false,
            "node": null,
            "relocating_node": null,
            "shard": 0,
            "index": "news",
            "version": 801,
            "unassigned_info": {
              "reason": "INDEX_REOPENED",
              "at": "2017-03-11T20:25:24.378Z"
            }
          }
        ],
        "1": [
          {
            "state": "INITIALIZING",
            "primary": true,
            "node": "1CKLV2W4TS6jP0BIuFctPQ",
            "relocating_node": null,
            "shard": 1,
            "index": "news",
            "version": 813,
            "allocation_id": {
              "id": "fxi3mcxaRqizjpyZeLKMyg"
            },
            "unassigned_info": {
              "reason": "ALLOCATION_FAILED",
              "at": "2017-03-11T20:27:42.555Z",
              "details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian_analyzer] failed to find filter under name [custom_stop]]; "
            }
          },
          {
            "state": "UNASSIGNED",
            "primary": false,
            "node": null,
            "relocating_node": null,
            "shard": 1,
            "index": "news",
            "version": 813,
            "unassigned_info": {
              "reason": "INDEX_REOPENED",
              "at": "2017-03-11T20:25:24.378Z"
            }
          }
        ],
        "2": [
          {
            "state": "INITIALIZING",
            "primary": true,
            "node": "1CKLV2W4TS6jP0BIuFctPQ",
            "relocating_node": null,
            "shard": 2,
            "index": "news",
            "version": 815,
            "allocation_id": {
              "id": "oA7ZGJ0MTjaO2Ev1z---UQ"
            },
            "unassigned_info": {
              "reason": "INDEX_CREATED",
              "at": "2017-03-11T20:27:42.694Z",
              "details": "force allocation from previous reason ALLOCATION_FAILED, failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian_analyzer] failed to find filter under name [custom_stop]]; "
            }
          },
          {
            "state": "UNASSIGNED",
            "primary": false,
            "node": null,
            "relocating_node": null,
            "shard": 2,
            "index": "news",
            "version": 815,
            "unassigned_info": {
              "reason": "INDEX_REOPENED",
              "at": "2017-03-11T20:25:24.378Z"
            }
          }
        ],
        "3": [
          {
            "state": "INITIALIZING",
            "primary": true,
            "node": "1CKLV2W4TS6jP0BIuFctPQ",
            "relocating_node": null,
            "shard": 3,
            "index": "news",
            "version": 803,
            "allocation_id": {
              "id": "oGOEogJTTE2AS38V02r1yQ"
            },
            "unassigned_info": {
              "reason": "ALLOCATION_FAILED",
              "at": "2017-03-11T20:27:42.555Z",
              "details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian_analyzer] failed to find filter under name [custom_stop]]; "
            }
          },
          {
            "state": "UNASSIGNED",
            "primary": false,
            "node": null,
            "relocating_node": null,
            "shard": 3,
            "index": "news",
            "version": 803,
            "unassigned_info": {
              "reason": "INDEX_REOPENED",
              "at": "2017-03-11T20:25:24.378Z"
            }
          }
        ],
        "4": [
          {
            "state": "INITIALIZING",
            "primary": true,
            "node": "1CKLV2W4TS6jP0BIuFctPQ",
            "relocating_node": null,
            "shard": 4,
            "index": "news",
            "version": 809,
            "allocation_id": {
              "id": "mYTAiqjtQfy3eOuJlEyrzQ"
            },
            "unassigned_info": {
              "reason": "ALLOCATION_FAILED",
              "at": "2017-03-11T20:27:42.416Z",
              "details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian_analyzer] failed to find filter under name [custom_stop]]; "
            }
          },
          {
            "state": "UNASSIGNED",
            "primary": false,
            "node": null,
            "relocating_node": null,
            "shard": 4,
            "index": "news",
            "version": 809,
            "unassigned_info": {
              "reason": "INDEX_REOPENED",
              "at": "2017-03-11T20:25:24.378Z"
            }
          }
        ]
      }
    }
  }
},
```

---

<div class="post-metadata">

**Author:** ![Sergei\_Malanin](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sergei\_Malanin](https://discuss.elastic.co/u/Sergei_Malanin)\
**Post date:** [March 11, 2017, 8:48pm UTC](https://discuss.elastic.co/t/topic/78256/5 "2017-03-11T20:48:33Z")

</div>

продолжение

"routing\_nodes": {  
"unassigned": [  
{  
"state": "UNASSIGNED",  
"primary": false,  
"node": null,  
"relocating\_node": null,  
"shard": 2,  
"index": "news",  
"version": 815,  
"unassigned\_info": {  
"reason": "INDEX\_REOPENED",  
"at": "2017-03-11T20:25:24.378Z"  
}  
},  
{  
"state": "UNASSIGNED",  
"primary": false,  
"node": null,  
"relocating\_node": null,  
"shard": 4,  
"index": "news",  
"version": 809,  
"unassigned\_info": {  
"reason": "INDEX\_REOPENED",  
"at": "2017-03-11T20:25:24.378Z"  
}  
},  
{  
"state": "UNASSIGNED",  
"primary": false,  
"node": null,  
"relocating\_node": null,  
"shard": 1,  
"index": "news",  
"version": 813,  
"unassigned\_info": {  
"reason": "INDEX\_REOPENED",  
"at": "2017-03-11T20:25:24.378Z"  
}  
},  
{  
"state": "UNASSIGNED",  
"primary": false,  
"node": null,  
"relocating\_node": null,  
"shard": 3,  
"index": "news",  
"version": 803,  
"unassigned\_info": {  
"reason": "INDEX\_REOPENED",  
"at": "2017-03-11T20:25:24.378Z"  
}  
},  
{  
"state": "UNASSIGNED",  
"primary": true,  
"node": null,  
"relocating\_node": null,  
"shard": 0,  
"index": "news",  
"version": 801,  
"unassigned\_info": {  
"reason": "ALLOCATION\_FAILED",  
"at": "2017-03-11T20:27:42.607Z",  
"details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian\_analyzer] failed to find filter under name [custom\_stop]]; "  
}  
},  
{  
"state": "UNASSIGNED",  
"primary": false,  
"node": null,  
"relocating\_node": null,  
"shard": 0,  
"index": "news",  
"version": 801,  
"unassigned\_info": {  
"reason": "INDEX\_REOPENED",  
"at": "2017-03-11T20:25:24.378Z"  
}  
},  
{  
"state": "UNASSIGNED",  
"primary": false,  
"node": null,  
"relocating\_node": null,  
"shard": 0,  
"index": ".kibana",  
"version": 4,  
"unassigned\_info": {  
"reason": "CLUSTER\_RECOVERED",  
"at": "2017-03-10T22:08:47.966Z"  
}  
}  
],  
"nodes": {  
"1CKLV2W4TS6jP0BIuFctPQ": [  
{  
"state": "INITIALIZING",  
"primary": true,  
"node": "1CKLV2W4TS6jP0BIuFctPQ",  
"relocating\_node": null,  
"shard": 2,  
"index": "news",  
"version": 815,  
"allocation\_id": {  
"id": "oA7ZGJ0MTjaO2Ev1z---UQ"  
},  
"unassigned\_info": {  
"reason": "INDEX\_CREATED",  
"at": "2017-03-11T20:27:42.694Z",  
"details": "force allocation from previous reason ALLOCATION\_FAILED, failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian\_analyzer] failed to find filter under name [custom\_stop]]; "  
}  
},  
{  
"state": "INITIALIZING",  
"primary": true,  
"node": "1CKLV2W4TS6jP0BIuFctPQ",  
"relocating\_node": null,  
"shard": 4,  
"index": "news",  
"version": 809,  
"allocation\_id": {  
"id": "mYTAiqjtQfy3eOuJlEyrzQ"  
},  
"unassigned\_info": {  
"reason": "ALLOCATION\_FAILED",  
"at": "2017-03-11T20:27:42.416Z",  
"details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian\_analyzer] failed to find filter under name [custom\_stop]]; "  
}  
},  
{  
"state": "INITIALIZING",  
"primary": true,  
"node": "1CKLV2W4TS6jP0BIuFctPQ",  
"relocating\_node": null,  
"shard": 1,  
"index": "news",  
"version": 813,  
"allocation\_id": {  
"id": "fxi3mcxaRqizjpyZeLKMyg"  
},  
"unassigned\_info": {  
"reason": "ALLOCATION\_FAILED",  
"at": "2017-03-11T20:27:42.555Z",  
"details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian\_analyzer] failed to find filter under name [custom\_stop]]; "  
}  
},  
{  
"state": "INITIALIZING",  
"primary": true,  
"node": "1CKLV2W4TS6jP0BIuFctPQ",  
"relocating\_node": null,  
"shard": 3,  
"index": "news",  
"version": 803,  
"allocation\_id": {  
"id": "oGOEogJTTE2AS38V02r1yQ"  
},  
"unassigned\_info": {  
"reason": "ALLOCATION\_FAILED",  
"at": "2017-03-11T20:27:42.555Z",  
"details": "failed to create index, failure IndexCreationException[failed to create index]; nested: IllegalArgumentException[Custom Analyzer [russian\_analyzer] failed to find filter under name [custom\_stop]]; "  
}  
},  
{  
"state": "STARTED",  
"primary": true,  
"node": "1CKLV2W4TS6jP0BIuFctPQ",  
"relocating\_node": null,  
"shard": 0,  
"index": ".kibana",  
"version": 4,  
"allocation\_id": {  
"id": "w3vkOuAOQv2OyxZuSkuG8Q"  
}  
}  
]  
}  
}  
}  
}`

---

<div class="post-metadata">

**Author:** ![Sergei\_Malanin](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Sergei\_Malanin](https://discuss.elastic.co/u/Sergei_Malanin)\
**Post date:** [March 11, 2017, 8:49pm UTC](https://discuss.elastic.co/t/topic/78256/6 "2017-03-11T20:49:11Z")

</div>

проверяю settings, фильтр с названием custom\_stop вроде на месте

```
`{

```

"news" : {  
"settings" : {  
"index" : {  
"creation\_date" : "1489263907513",  
"analysis" : {  
"analyzer" : {  
"russian\_analyzer" : {  
"filter" : ["stop", "custom\_stop", "russian\_stop", "custom\_word\_delimiter", "lowercase", "russian\_morphology", "english\_morphology"],  
"char\_filter" : ["html\_strip", "ru"],  
"type" : "custom",  
"tokenizer" : "standard"  
}  
},  
"char\_filter" : {  
"ru" : {  
"type" : "mapping",  
"mappings" : ["Ё=\>Е", "ё=\>е"]  
}  
},  
"filter:" : {  
"custom\_stop" : {  
"type" : "stop",  
"stopwords" : ["n", "r"]  
},  
"russian\_stop" : {  
"ignore\_case" : "true",  
"type" : "stop",  
"stopwords" : ["а", "без", "более", "бы", "был", "была", "были", "было", "быть", "в", "вам", "вас", "весь", "во", "вот", "все", "всего", "всех", "вы", "где", "да", "даже", "для", "до", "его", "ее", "если", "есть", "еще", "же", "за", "здесь", "и", "из", "или", "им", "их", "к", "как", "ко", "когда", "кто", "ли", "либо", "мне", "может", "мы", "на", "надо", "наш", "не", "него", "нее", "нет", "ни", "них", "но", "ну", "о", "об", "однако", "он", "она", "они", "оно", "от", "очень", "по", "под", "при", "с", "со", "так", "также", "такой", "там", "те", "тем", "то", "того", "тоже", "той", "только", "том", "ты", "у", "уже", "хотя", "чего", "чей", "чем", "что", "чтобы", "чье", "чья", "эта", "эти", "это", "я"]  
},  
"custom\_word\_delimiter" : {  
"split\_on\_numerics" : "false",  
"generate\_word\_parts" : "false",  
"preserve\_original" : "true",  
"catenate\_words" : "true",  
"generate\_number\_parts" : "true",  
"catenate\_all" : "true",  
"split\_on\_case\_change" : "false",  
"type" : "word\_delimiter",  
"catenate\_numbers" : "false"  
}  
}  
},  
"number\_of\_shards" : "5",  
"number\_of\_replicas" : "1",  
"uuid" : "V\_O095dtTpWhlkV5GxtIcw",  
"version" : {  
"created" : "2040499"  
}  
}  
}  
}  
}  
`  
Уже не знаю куда копать. подскажите куда копать, или может в settings ошибка.  
Причем если из analyzer.russian\_analyzer.filter убрать custom\_stop то начинает ругаться на следующий фильтр russian\_stop. Получается ES не видит фильтры? или я их куда то не туда записываю?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 8, 2017, 8:49pm UTC](https://discuss.elastic.co/t/topic/78256/7 "2017-04-08T20:49:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
