{"action":"opened","issue":{"url":"https://api.github.com/repos/medcl/elasticsearch-analysis-mmseg/issues/34","repository_url":"https://api.github.com/repos/medcl/elasticsearch-analysis-mmseg","labels_url":"https://api.github.com/repos/medcl/elasticsearch-analysis-mmseg/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/medcl/elasticsearch-analysis-mmseg/issues/34/comments","events_url":"https://api.github.com/repos/medcl/elasticsearch-analysis-mmseg/issues/34/events","html_url":"https://github.com/medcl/elasticsearch-analysis-mmseg/issues/34","id":207703198,"number":34,"title":"mmseg cause elasticsearch 5.2.0 shards unassigned","user":{"login":"jayqie","id":2605076,"avatar_url":"https://avatars.githubusercontent.com/u/2605076?v=3","gravatar_id":"","url":"https://api.github.com/users/jayqie","html_url":"https://github.com/jayqie","followers_url":"https://api.github.com/users/jayqie/followers","following_url":"https://api.github.com/users/jayqie/following{/other_user}","gists_url":"https://api.github.com/users/jayqie/gists{/gist_id}","starred_url":"https://api.github.com/users/jayqie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayqie/subscriptions","organizations_url":"https://api.github.com/users/jayqie/orgs","repos_url":"https://api.github.com/users/jayqie/repos","events_url":"https://api.github.com/users/jayqie/events{/privacy}","received_events_url":"https://api.github.com/users/jayqie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-15T04:03:42Z","updated_at":"2017-02-15T04:03:42Z","closed_at":null,"body":"我用elasticsearch 5.2.0 上的mmseg的时候，经常会出现mmseg导致shards unassigned的情况。\r\n比如这个配置：\r\n{\r\n  \"settings\": {\r\n    \"number_of_shards\": 3,\r\n    \"number_of_replicas\": 1,\r\n    \"index.routing.allocation.include.cluster\": \"na\",\r\n    \"index.mapper.dynamic\": false,\r\n    \"analysis\": {\r\n      \"filter\": {\r\n        \"stop_filter\": {\r\n          \"type\": \"stop\",\r\n          \"stopwords_path\": \"stopwords.txt\",\r\n          \"ignore_case\": true\r\n        },\r\n        \"synonym_filter\": {\r\n          \"type\": \"synonym\",\r\n          \"synonyms_path\": \"synonyms.txt\",\r\n          \"ignore_case\": true,\r\n          \"expand\": true\r\n        }\r\n      },\r\n      \"analyzer\": {\r\n        \"text_auto\": {\r\n          \"type\": \"custom\",\r\n          \"tokenizer\": \"keyword\",\r\n          \"filter\": [\r\n            \"lowercase\"\r\n          ]\r\n        },\r\n        \"text_complex\": {\r\n          \"type\": \"custom\",\r\n          \"tokenizer\": \"mmseg_complex\",\r\n          \"filter\": [\r\n            \"stop_filter\",\r\n            \"synonym_filter\",\r\n            \"lowercase\"\r\n          ]\r\n        },\r\n        \"text_maxword\": {\r\n          \"type\": \"custom\",\r\n          \"tokenizer\": \"mmseg_maxword\",\r\n          \"filter\": [\r\n            \"stop_filter\",\r\n            \"synonym_filter\",\r\n            \"lowercase\"\r\n          ]\r\n        },\r\n        \"standard_text\": {\r\n          \"type\": \"custom\",\r\n          \"tokenizer\": \"standard\",\r\n          \"filter\": [\r\n            \"lowercase\"\r\n          ]\r\n        }\r\n      }\r\n    }\r\n  },\r\n在bulk 建索引的时候，会报这个错误：\r\n[2017-02-15T11:54:11,011][DEBUG][o.e.a.b.TransportShardBulkAction] [datagrand-data-1] [duizhuang_v4][1] failed to execute bulk item (index) index {[duizhuang][duizhuang][878791], source[{\"itemid\": \"878791\", \"last_update_time\": 1487051295, \"title\": \"H\\u98d8\\u5f69\\u7ae5\\u5b50\\u4f5b\\uff0c\\u7389\\u8d28\\u7ec6\\u817b\\uff0c\\u79cd\\u8001\\u7eaf\\u51c0\\u3002\\u5b8c\\u7f8e\\uff0c\\u4eae\\u5ea6\\u9ad8\\uff0c\\u54c1\\u8d28\\u7cbe\\u54c1\\uff01\\u5c3a\\u5bf840*16.3*6.6\\u3002\\u8d85\\u503c\\u63a8\\u83508\", \"item_score\": 333000.0, \"price\": 500000, \"item_modify_time\": 1486590407, \"title1\": \"H\\u98d8\\u5f69\\u7ae5\\u5b50\\u4f5b\\uff0c\\u7389\\u8d28\\u7ec6\\u817b\\uff0c\\u79cd\\u8001\\u7eaf\\u51c0\\u3002\\u5b8c\\u7f8e\\uff0c\\u4eae\\u5ea6\\u9ad8\\uff0c\\u54c1\\u8d28\\u7cbe\\u54c1\\uff01\\u5c3a\\u5bf840*16.3*6.6\\u3002\\u8d85\\u503c\\u63a8\\u83508\", \"create_time\": 1486713188, \"item_tags\": \"\", \"cateid\": \"2_13\", \"id\": \"878791\"}]}\r\njava.lang.NullPointerException: null\r\n\r\n从而导致elasticsearch 的shards allocate失败，只剩一个primary replica可以work，\r\n![error](https://cloud.githubusercontent.com/assets/2605076/22960152/a4e54bfa-f376-11e6-9678-4ff0ad2504e6.jpg)\r\n\r\n点击unassigned的1分片，可以看到错误如下：\r\n\"details\": \"failed recovery, failure RecoveryFailedException[[duizhuang_v4][1]: Recovery failed from {datagrand-data-1}{de1cbfW0TT60i0I0WF9Dnw}{_8mhUy4DT4qwGXEEJLzf0w}{10.45.139.177}{10.45.139.177:9300}{cluster=rec, cpu=high, disk=low, cluster_awareness=rec, memory=high, ssd=yes} into {datagrand-data-3}{el9GeOaEREmcp_s33BX1YA}{DEFEaqphRhSCxqIdYtJJFw}{10.26.241.224}{10.26.241.224:9300}{cluster=rec, disk=low, cluster_awareness=rec, memory=medium, ssd=yes, cpu=high}]; nested: RemoteTransportException[[datagrand-data-1][10.45.139.177:9300][internal:index/shard/recovery/start_recovery]]; nested: RecoveryEngineException[Phase[2] phase2 failed]; nested: RemoteTransportException[[datagrand-data-3][10.26.241.224:9300][internal:index/shard/recovery/translog_ops]]; nested: BatchOperationException[failed to apply batch translog operation]; nested: NullPointerException; \","}}
{"actor":{"display_login":"jayqie"}}