有個問題必須注意,小內存跑不起來,內存申請失敗,建議至少4個G吧java
下面是java配置git
JAVA_HOME=/usr/javajdk1.8.0_151
JRE_HOME=/usr/java/jdk1.8.0_151/jre
CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATHgithub
如下是安裝Elasticsearchbootstrap
命令一:groupadd elsearchelasticsearch
命令二:useradd elsearch -g elsearchoop
命令三:chown -R elsearch:elsearch elasticsearch-5.6.3 該命令是更改該文件夾下所屬的用戶組的權限.net
3.2.4 建立ES數據文件和日誌文件,直接在root用戶根目錄一下建立就能夠了線程
執行命令:mkdir /data日誌
命令二:chown -R elsearch:elsearch /data/ip
命令三:su - elsearch 切換用戶
命令四:mkdir -p es/data
命令五:mkdir -p es/logs
啓動遇到的問題:
1)max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
緣由:沒法建立本地文件問題,用戶最大可建立文件數過小
解決方案:切換到root用戶,編輯limits.conf配置文件, 添加相似以下內容:
vi /etc/security/limits.conf
添加以下內容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
備註:* 表明Linux全部用戶名稱(好比 hadoop)
須要保存、退出、從新登陸纔可生效。
2)max number of threads [1024] for user [es] likely too low, increase to at least [2048]
緣由:沒法建立本地線程問題,用戶最大可建立線程數過小
解決方案:切換到root用戶,進入limits.d目錄下,修改90-nproc.conf 配置文件。
vi /etc/security/limits.d/90-nproc.conf
找到以下內容:
* soft nproc 1024
#修改成
* soft nproc 2048
3)max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
緣由:最大虛擬內存過小
root用戶執行命令:
[root@localhost ~]# sysctl -w vm.max_map_count=262144
4)system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
緣由:Centos6不支持SecComp,而ES5.4.1默認bootstrap.system_call_filter爲true進行檢測,因此致使檢測失敗,失敗後直接致使ES不能啓動。
詳見 :https://github.com/elastic/elasticsearch/issues/22899
解決方法:在elasticsearch.yml中新增配置bootstrap.system_call_filter,設爲false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
以上問題解決後,es啓動成功了,