LoginSignup
2
6

More than 3 years have passed since last update.

シングル構成のelasticsearchでnetwork.hostを設定すると起動しない(development modeとproduction mode )

Last updated at Posted at 2019-08-27

やりたいこと

ちょっとしたDBとしてelasticsearchをシングル構成で使いたい。
elasticsearchは別サーバのGrafanaからアクセスするので、
localhost以外からアクセスできるようにしたい。

ところが、elasticsearchの設定をしていると、起動しなくなった。
原因が分かるまでそこそこはまった話。

elasticsearchがnetwork.hostを設定すると起動しない

いろいろ設定を試したところ、
elasticsearchをlocalhost以外からもアクセスできるようにするnetwork.hostを設定すると、起動しなくなった。

理由は公式ページにあった。
https://www.elastic.co/guide/en/elasticsearch/reference/current/system-config.html#dev-vs-prod

elasticsearchはnetwork.hostを設定すると、
development modeからproduction modeになり、安全のためにシングルのノードは起動しないようになるということらしい。

じゃあ、どうすればいいか?
これも公式に書いてあった。

シングル構成で起動する設定

下記の設定を追記すればOK。
network.hostの設定も不要。

/etc/elasticsearch/elasticsearch.yml
discovery.type: single-node

公式のリンク
https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
https://discuss.elastic.co/t/elasticsearch-5-6-installation-single-node/118549

2
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
6