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 

 

 

 踩坑完畢,希望可以幫到大家


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM