1. 程式人生 > >ElasticSearch外網訪問9200端口

ElasticSearch外網訪問9200端口

修改配置文件 sin 執行 script stopped 外網 linux 出現 type

第一步、修改ElasticSearch根目錄下的config文件夾下的elasticsearch.yml文件,如圖

  技術分享圖片

  現在啟動服務你會發現出現3個錯誤

  

elasticsearch 5.1 安裝過程中遇到了一些問題做一些記錄。
 
問題一:警告提示
[2016-12-20T22:37:28,543][INFO ][o.e.b.BootstrapCheck     ] [elk-node1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2016
-12-20T22:37:28,552][ERROR][o.e.b.Bootstrap ] [elk-node1] node validation exception bootstrap checks failed max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048] [2016-12-20T22:37:28,560][INFO ][o.e.n.Node ] [elk-node1] stopping ... [2016-12-20T22:37
:28,628][INFO ][o.e.n.Node ] [elk-node1] stopped [2016-12-20T22:37:28,629][INFO ][o.e.n.Node ] [elk-node1] closing ... [2016-12-20T22:37:28,677][INFO ][o.e.n.Node ] [elk-node1] closed 報了一大串錯誤,其實只是一個警告。 解決:使用新的linux版本,就不會出現此類問題了。 問題二:ERROR: bootstrap checks failed max file descriptors [
4096] for elasticsearch process likely too low, increase to at least [65536] max number of threads [1024] for user [lishang] likely too low, increase to at least [2048] 解決:切換到root用戶,編輯limits.conf 添加類似如下內容 vi /etc/security/limits.conf 添加如下內容: * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096 問題三:max number of threads [1024] for user [lish] likely too low, increase to at least [2048] 解決:切換到root用戶,進入limits.d目錄下修改配置文件。 vi /etc/security/limits.d/90-nproc.conf 修改如下內容: * soft nproc 1024 #修改為 * soft nproc 2048 問題四:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144] 解決:切換到root用戶修改配置sysctl.conf vi /etc/sysctl.conf 添加下面配置: vm.max_map_count=655360 並執行命令: sysctl -p 然後,重新啟動elasticsearch,即可啟動成功。

然後在本機上輸入本機ip:9200測試即可

  

  

  

  1. elasticsearch 5.1 安裝過程中遇到了一些問題做一些記錄。
  2. 問題一:警告提示
  3. [2016-12-20T22:37:28,543][INFO ][o.e.b.BootstrapCheck ] [elk-node1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
  4. [2016-12-20T22:37:28,552][ERROR][o.e.b.Bootstrap ] [elk-node1] node validation exception
  5. bootstrap checks failed
  6. max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
  7. [2016-12-20T22:37:28,560][INFO ][o.e.n.Node ] [elk-node1] stopping ...
  8. [2016-12-20T22:37:28,628][INFO ][o.e.n.Node ] [elk-node1] stopped
  9. [2016-12-20T22:37:28,629][INFO ][o.e.n.Node ] [elk-node1] closing ...
  10. [2016-12-20T22:37:28,677][INFO ][o.e.n.Node ] [elk-node1] closed
  11. 報了一大串錯誤,其實只是一個警告。
  12. 解決:使用心得linux版本,就不會出現此類問題了。
  13. 問題二:ERROR: bootstrap checks failed
  14. max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
  15. max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
  16. 解決:切換到root用戶,編輯limits.conf 添加類似如下內容
  17. vi /etc/security/limits.conf
  18. 添加如下內容:
  19. * soft nofile 65536
  20. * hard nofile 131072
  21. * soft nproc 2048
  22. * hard nproc 4096
  23. 問題三:max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
  24. 解決:切換到root用戶,進入limits.d目錄下修改配置文件。
  25. vi /etc/security/limits.d/90-nproc.conf
  26. 修改如下內容:
  27. * soft nproc 1024
  28. #修改為
  29. * soft nproc 2048
  30. 問題四:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
  31. 解決:切換到root用戶修改配置sysctl.conf
  32. vi /etc/sysctl.conf
  33. 添加下面配置:
  34. vm.max_map_count=655360
  35. 並執行命令:
  36. sysctl -p
  37. 然後,重新啟動elasticsearch,即可啟動成功。

ElasticSearch外網訪問9200端口