elasticsearch外網訪問設置

默認狀況下安裝elasticsearch以後是沒法進行外網訪問的,能夠經過設置來完成這一目的git

一、更改配置文件github

[***@elk01 ~]$ vim elk/config/elasticsearch.yml

找到network.host這一行,更改成bootstrap

network.host: 0.0.0.0

注意:vim

:後面須要一個空格,格式不正確會報錯誤

二、重啓服務,發現報錯elasticsearch

ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

三、以root帳戶更改/etc/sysctl.conf文件,添加以下內容spa

vm.max_map_count=655360

四、以root帳戶執行下面命令code

[***@elk01 ~]$ sudo sysctl -p
vm.max_map_count = 655360

五、再次啓動服務,開放9200端口。在另臺機器訪問blog

啓動報錯:get

5.2.0,安裝完一直啓動不了,能夠說是一個bug。
報錯:it

ERROR: bootstrap checks failed
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

緣由:
這是在由於Centos6不支持SecComp,而ES5.2.0默認bootstrap.system_call_filter爲true進行檢測,因此致使檢測失敗,失敗後直接致使ES不能啓動。

解決:
在elasticsearch.yml中配置bootstrap.system_call_filter爲false,注意要在Memory下面:

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

能夠查看issues
https://github.com/elastic/elasticsearch/issues/22899

二、ERROR: bootstrap checks failed

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

臨時設置:sudo sysctl -w vm.max_map_count=262144 永久修改: 修改/etc/sysctl.conf 文件,添加 「vm.max_map_count」設置 並執行:sysctl -p

相關文章
相關標籤/搜索