1.下載ES tar.gz 2.解壓到指定目錄 tar -zxvf aaa.tar.gz -C [指定目錄]
配置elasticsearch.yml
如果centos6,由于系統(tǒng)版本低需要加:bootstrap.system_call_filter: false
vi /etc/security/limits.d/90-nproc.conf? ,修改為4096 【允許最大用戶進(jìn)程數(shù)】
centos6是90-nproc.conf株茶,centos7是20-nproc.conf
先執(zhí)行 sysctl -w vm.max_map_count=262144 来涨,即刻生效,但是重啟會失效启盛,所以需要修改配置文件 【允許一個進(jìn)程的最大虛擬內(nèi)存區(qū)域數(shù)量】
vi /etc/sysctl.conf? 添加一行
vm.max_map_count = 262144
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
centos7 要修改?/etc/security/limits.conf 文件? 增加:
*? ? ? ? ? ? ? soft? ? ?nofile? ? ? ? ? 65536
*? ? ? ? ? ? ? hard? ? nofile? ? ? ? ? 65536
參考:?https://www.cnblogs.com/zhi-leaf/p/8484337.html
discovery.zen.minimum_master_nodes : 2 這個參數(shù)=(n/2)+1,n是主節(jié)點的個數(shù)(所謂主節(jié)點蹦掐,就是配置了node.master: true,可被候選為mater的 節(jié)點成為主節(jié)點,而實際運行中一個集群只會有一個master)
discovery.zen.ping.unicast.hosts:[host1,host2],這個參數(shù)可以不加9300,9300是集群內(nèi)節(jié)點間TCP通信的端口
elasticsearch需要以普通用戶權(quán)限去啟動驰徊,root啟動會報錯
添加普通用戶:useradd es 笤闯,然后將elasticsearch 的目錄權(quán)限賦給es用戶,chown -R es /opt/elasticsearch
es 的日志和數(shù)據(jù)默認(rèn)存儲在工作目錄下下的logs和data目錄棍厂,需要自定義可以增加颗味,data目錄支持多個