linux安装elasticsearch开启外网访问时所踩得坑
今天心血来潮在虚拟机上搭了个elasticsearch用来跑以前写的一个日志收集项目,基本网上所踩得坑我全踩了(mmp.......),以下就是我踩坑的全过程。
1、首先启动后报了个:X-Pack is not supported and Machine Learning is not available for [linux-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml
解决方案:去到elasticsearch的配置文件中 config/elasticsearch.yml新增一条配置: xpack.ml.enabled: false
2、在配置文件增加外网配置以后如下图所示
出现了一堆错误:
一个个解决
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
解决:在/etc/security/limits.conf 文件中加入这几行配置
加入之后使用ulimit -Hu命令查看发现结果还是4096的话,就继续在/etc/profile中加入ulimit -SHn 65536 就可以成功解决
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:修改/etc/sysctl.conf文件,增加配置vm.max_map_count=262144
执行:sysctl -p 后可以生效
[3]: JVM is using the client VM [Java HotSpot(TM) Client VM] but should be using a server VM for the best performance
解决:打开你安装的jdk文件下的 jre/lib/i386/jvm.cfg 修改配置信息的位置
[4]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
解决:contos6不支持SecComp,打开elasticsearch下的配置文件 config/elasticsearch.yml 新增两行配置
[5]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
解决:取消注释保留一个节点,打开elasticsearch下的配置文件 config/elasticsearch.yml
踩坑完毕,希望可以帮到大家