Elasticsearchを導入しようとしたらエラーで起動しても速攻死ぬ問題
Elasticsearchを起動したが、どうやら立ち上がってないようだった。
そこで /var/log/elasticsearch/elasticsearch.log
に記述されているログを確認した
[2017-09-28T07:44:50,362][INFO ][o.e.n.Node ] [5MEDJRz] starting ...
[2017-09-28T07:44:50,766][INFO ][o.e.t.TransportService ] [5MEDJRz] publish_address {10.0.2.15:9300}, bound_addresses {[::]:9300}
[2017-09-28T07:44:50,829][INFO ][o.e.b.BootstrapChecks ] [5MEDJRz] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-09-28T07:44:50,850][ERROR][o.e.b.Bootstrap ] [5MEDJRz] node validation exception
[2] bootstrap checks failed
[1]: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
[2]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2017-09-28T07:44:50,860][INFO ][o.e.n.Node ] [5MEDJRz] stopping ...
[2017-09-28T07:44:50,995][INFO ][o.e.n.Node ] [5MEDJRz] stopped
[2017-09-28T07:44:50,995][INFO ][o.e.n.Node ] [5MEDJRz] closing ...
[2017-09-28T07:44:51,020][INFO ][o.e.n.Node ] [5MEDJRz] closed
起動しても速攻落ちてるんかーい!
調べてみた
一つ目
[2]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
https://www.elastic.co/guide/en/elasticsearch/reference/current/system-call-filter-check.html
ふむふむ、これの対応として、以下を /etc/elasticsearch/elasticsearch.yml
に追記すれば良いんですね
bootstrap.system_call_filter: false
二つ目
[1]: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html
このやり方は正しくはないだろうが、 /etc/sysconfig/init
に以下を追記しました。a
ulimit -n 65536
結果...
やったね!