在单节点的Elasticsearch中设置network.host会导致无法启动(开发模式和生产模式)
想做的事情
我想将elasticsearch用作一个小型单节点的数据库。
由于elasticsearch将从另一台服务器的Grafana进行访问,
所以我希望可以从localhost以外的其他地方访问它。
然而,在配置elasticsearch时,它停止了启动。直到找到原因,我遇到了一些困难。
当Elasticsearch设置了network.host之后无法启动。
试过了各种设置后,将elasticsearch的network.host设置为可以从本地主机之外访问,结果无法启动。
理由在官方网页上可以找到。
https://www.elastic.co/guide/en/elasticsearch/reference/current/system-config.html#dev-vs-prod
似乎当将network.host设置为elasticsearch时,
它将从开发模式切换到生产模式,并为安全起见停止启动单一节点。
那么,我们应该怎么办呢?
这同样也在官方文件中写得很清楚。
以单个配置启动
只要添加以下设置即可。
无需设置network.host。
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