elasticsearch 通过外网访问

elasticsearch 只能通过本地访问

需要修改  network.host: 0.0.0.0、

重新开启:提示错误:

ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法:

1:修改 ,为用户修改软硬连接数

网上的解决办法都是修改/etc/security/limits.conf文件,增加liyafei hard nofile 131072一行 ,liyafei 是用户名,* 代表所有用户

vi /etc/security/limits.conf
liyafei soft nofile 65536
liyafei hard nofile 131072
liyafei soft nproc 2048   //有可能需要更大
liyafei hard nproc 4096

2:

使用下面的方法临时使其生效

$ sudo sysctl -w vm.max_map_count=262144

或者修改 /etc/sysctl.conf 文件,添加 “vm.max_map_count=262144”设置

设置后,可以使用

$ sysctl -a



3::通过上面两种方法设置后还是提示:[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
通过查看环境变量
>> ulimit -n
结果为 1024
应该将其设为 65536
所以进入到root用户下
>>sudo -i
编辑 >> vi /etc/profile
添加 ulimit -n 65536
保存 >>source /etc/profile
查看 >> ulimit -n
65536
重启使配置生效
4:重启 elasticsearch ,成功;能够通过 http://192.168.100.91:9200访问

 

posted @ 2018-03-12 16:58  1367356  阅读(223)  评论(0编辑  收藏  举报