# 起動時に突然killされるようになりました。

**URL:** <https://discuss.elastic.co/t/kill/181541>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [May 17, 2019, 8:13am UTC](https://discuss.elastic.co/t/kill/181541 "2019-05-17T08:13:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![6f14f6d3449152ab0d18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6f14f6d3449152ab0d18/32/46366_2.png) [@6f14f6d3449152ab0d18](https://discuss.elastic.co/u/6f14f6d3449152ab0d18)\
**Post date:** [May 17, 2019, 8:13am UTC](https://discuss.elastic.co/t/kill/181541/1 "2019-05-17T08:13:37Z")

</div>

すみません。  
私は営業企画部門に所属しておりまして、  
的を得ない質問をしてしまうかもしれないのですが。

昨日まで可動していたelasticsearchが突然止まってしまい、  
再起動を行おうとすると起動の工程で突然killedされてしまいます。

起動の工程でのkilledの箇所も毎回異なっており、

```auto
[2019-05-17T17:10:13,005][INFO][o.e.h.n.Netty4HttpServerTransport] [1bITOOv] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2019-05-17T17:10:13,005][INFO][o.e.n.Node] [1bITOOv] started
Killed

```

```auto
[2019-05-17T17:13:03,856][INFO][o.e.h.n.Netty4HttpServerTransport] [1bITOOv] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2019-05-17T17:13:03,856][INFO][o.e.n.Node] [1bITOOv] started
[2019-05-17T17:13:07,019][INFO][o.e.x.m.p.NativeController] [1bITOOv] Native controller process has stopped - no new native processes can be started
Killed

```

```auto
[2019-05-17T17:18:38,043][INFO][o.e.n.Node] [1bITOOv] started
[2019-05-17T17:18:39,531][WARN][o.e.x.s.a.s.m.NativeRoleMappingStore] [1bITOOv] Failed to clear cache for realms [[]]
[2019-05-17T17:18:39,588][INFO][o.e.l.LicenseService] [1bITOOv] license [0425af20-3e7a-40df-95a3-f916cdd95fb9] mode [basic] - valid
[2019-05-17T17:18:39,597][INFO][o.e.g.GatewayService] [1bITOOv] recovered [34] indices into cluster_state
Killed

```

など様々な箇所でkillされてしまいます。

起動時のログの上部を見ると、怪しそうなのは、このあたりなのですが、何が問題なのかご教示いただけませんでしょうか。

```auto
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

```

```auto
max number of threads [1024] for user [---------] is too low, increase to at least [4096]

```

elasticsearch 6.6.1  
CentOS release 6.9  
を利用しております。

---

<div class="post-metadata">

**Author:** ![tsgkdt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsgkdt/32/39151_2.png) [@tsgkdt](https://discuss.elastic.co/u/tsgkdt)\
**Post date:** [May 17, 2019, 8:39am UTC](https://discuss.elastic.co/t/kill/181541/2 "2019-05-17T08:39:04Z")

</div>

Elasticsearchがどんだけファイルを開くか、スレッドをたてられるか、の上限があまりにも低く設定されているので、  
データ量やその他の要因で突然起動しなくなったように見えるということではないでしょうか。

「at least `少なくとも`この値にせよ」とある値よりも小さい値が設定されていることが問題だと思います。  
まずはここを設定しなおしてから現象が出るかどうか、見てもらうのが良いように思います。

ファイルディスクリプタ -\> 65536かそれ以上  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.6/file-descriptors.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/file-descriptors.html)

スレッド 少なくとも4096  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.6/max-number-of-threads.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/max-number-of-threads.html)

---

<div class="post-metadata">

**Author:** ![6f14f6d3449152ab0d18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6f14f6d3449152ab0d18/32/46366_2.png) [@6f14f6d3449152ab0d18](https://discuss.elastic.co/u/6f14f6d3449152ab0d18)\
**Post date:** [May 17, 2019, 9:05am UTC](https://discuss.elastic.co/t/kill/181541/3 "2019-05-17T09:05:32Z")

</div>

素早い回答をありがとうございます。  
また、的確なリンクをありがとうございます。

/etc/security/limits.confファイルの編集権限がなかったため、編集した後に試してみて、また返答させていただきます。

---

<div class="post-metadata">

**Author:** ![6f14f6d3449152ab0d18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6f14f6d3449152ab0d18/32/46366_2.png) [@6f14f6d3449152ab0d18](https://discuss.elastic.co/u/6f14f6d3449152ab0d18)\
**Post date:** [May 17, 2019, 10:02am UTC](https://discuss.elastic.co/t/kill/181541/4 "2019-05-17T10:02:11Z")

</div>

ご回答、ありがとうございました。  
無事起動できるようになりました。

---

<div class="post-metadata">

**Author:** ![6f14f6d3449152ab0d18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/6f14f6d3449152ab0d18/32/46366_2.png) [@6f14f6d3449152ab0d18](https://discuss.elastic.co/u/6f14f6d3449152ab0d18)\
**Post date:** [May 17, 2019, 10:06am UTC](https://discuss.elastic.co/t/kill/181541/5 "2019-05-17T10:06:11Z")

</div>

起動はできたのですが・・・。  
ただ、不思議なことに起動時のメッセージは変わってませんでした・・・。  
/etc/security/limits.confファイルを書き換えて再起動してみたんですが・・・

うーん、再起動によってなにか別の問題が解決されたようです。

```auto
[2019-05-17T19:04:16,752][WARN][o.e.b.BootstrapChecks] [1bITOOv] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65 536]
[2019-05-17T19:04:16,752][WARN][o.e.b.BootstrapChecks] [1bITOOv] max number of threads [1024] for user [-------] is too low, increase to at least [4096]
[2019-05-17T19:04:16,753][WARN][o.e.b.BootstrapChecks] [1bITOOv] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

```

---

<div class="post-metadata">

**Author:** ![tsgkdt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsgkdt/32/39151_2.png) [@tsgkdt](https://discuss.elastic.co/u/tsgkdt)\
**Post date:** [May 17, 2019, 11:09am UTC](https://discuss.elastic.co/t/kill/181541/6 "2019-05-17T11:09:35Z")

</div>

念のため、３つ目に出ている vm.max\_map\_countの設定も確認いただいておくとよいと思います。

マニュアルでは、以下のページです。

> **[Virtual memory | Elasticsearch Guide \[6.6\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/vm-max-map-count.html)**

類似の環境設定まわりの投稿もあります。ご参考までに。

> [@Elasticsearch 起動後のcurlを使った正常性確認でエラー](https://discuss.elastic.co/t/elasticsearch-curl/178141):
>
> 基本的がわかっておらず恐縮ですがご教授ください。 linux(Ubuntu)でbin/elasticsearchでelasticsearchを起動した後、 別のシェルからcurl http://localhost:9200と打つと ERROR &nbsp; ページを表示できません &nbsp; といったような表示が出てしまいます。一方、ブラウザでhttp://localhost:9200/ で確認すると、正常に { "name" : "nekamodel", "cluster\_name" : "elasticsearch", "cluster\_uuid" : "Z4NTsl-7QiabAzkC7ZfobQ", "version" : { "number" : "7.0.0", "build\_flavor" : "default", "build\_type" : "tar", "build\_hash" : "b7e28a7", "build\_date" : "2019-04-05T22:55:32.69…

---

<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:** [June 14, 2019, 11:09am UTC](https://discuss.elastic.co/t/kill/181541/7 "2019-06-14T11:09:37Z")

</div>

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