ElasticSearch外网访问9200端口

Posted xuchangqi1

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ElasticSearch外网访问9200端口相关的知识,希望对你有一定的参考价值。

 

第一步、修改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.  
    问题一:警告提示
  4.  
    [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
  5.  
    [2016-12-20T22:37:28,552][ERROR][o.e.b.Bootstrap          ] [elk-node1] node validation exception
  6.  
    bootstrap checks failed
  7.  
    max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]
  8.  
    [2016-12-20T22:37:28,560][INFO ][o.e.n.Node               ] [elk-node1] stopping ...
  9.  
    [2016-12-20T22:37:28,628][INFO ][o.e.n.Node               ] [elk-node1] stopped
  10.  
    [2016-12-20T22:37:28,629][INFO ][o.e.n.Node               ] [elk-node1] closing ...
  11.  
    [2016-12-20T22:37:28,677][INFO ][o.e.n.Node               ] [elk-node1] closed
  12.  
     
  13.  
    报了一大串错误,其实只是一个警告。
  14.  
     
  15.  
    解决:使用心得linux版本,就不会出现此类问题了。
  16.  
     
  17.  
    问题二:ERROR: bootstrap checks failed
  18.  
    max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
  19.  
    max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
  20.  
    解决:切换到root用户,编辑limits.conf 添加类似如下内容
  21.  
    vi /etc/security/limits.conf 
  22.  
     
  23.  
    添加如下内容:
  24.  
     
  25.  
    * soft nofile 65536
  26.  
    * hard nofile 131072
  27.  
    * soft nproc 2048
  28.  
    * hard nproc 4096
  29.  
     
  30.  
    问题三:max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
  31.  
     
  32.  
    解决:切换到root用户,进入limits.d目录下修改配置文件。
  33.  
    vi /etc/security/limits.d/90-nproc.conf 
  34.  
    修改如下内容:
  35.  
     
  36.  
    * soft nproc 1024
  37.  
    #修改为
  38.  
    * soft nproc 2048
  39.  
     
  40.  
    问题四:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
  41.  
     
  42.  
    解决:切换到root用户修改配置sysctl.conf
  43.  
     
  44.  
    vi /etc/sysctl.conf 
  45.  
    添加下面配置:
  46.  
    vm.max_map_count=655360
  47.  
    并执行命令:
  48.  
    sysctl -p
  49.  
    然后,重新启动elasticsearch,即可启动成功。

以上是关于ElasticSearch外网访问9200端口的主要内容,如果未能解决你的问题,请参考以下文章

如何从外网访问内网Elasticsearch WEB

elasticsearch this is not a http port

阿里云ECS安装配置elasticsearch之坑

Elasticsearch外网无法通过ip访问

无法访问9200端口的ElasticSearch服务

elasticsearch 安装