安装elasticsearch5.0

0.需求
java8
1. 下载
elasticsearch官网
下载地址
2. 解压
unzip elasticsearch-.zip -d elasticsearch | tar -zxvf elasticsearch-.tar.gz
3. 运行
./elasticsearch/bin/elasticsearch
4. 报错分析
Q1:initial heap size [33554432] not equal to maximum heap size [522190848]; this can cause resize pauses and prevents mlockall from locking the entire heap
A1:cp /etc/elasticsearch/jvm.options /usr/share/elasticsearch/config/jvm.options,并将-Xmx2g 改成 -Xmx256m ,也就是heap size [268435456] /1024/1024的值
Q2:max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
A2:

cp /etc/security/limits.conf /etc/security/limits.conf.bak
vim /etc/security/limits.conf
malu hard nofile 65536
malu soft nofile 65536
其中malu是启动ElasticSearch的用户名
修改后重新登录malu用户,使用如下命令查看是否修改成功
[malu@localhost ~]$ ulimit -Hn 65536

Q3:please set [discovery.zen.minimum_master_nodes] to a majority of the number of master eligible nodes in your cluster
A3:配置文件elasticsearch.yml里设置:discovery.zen.minimum_master_nodes: 1
Q4:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
A4:

最大线程数设置过小,需要root用户来设置:
sysctl -w vm.max_map_count=262144
查看:
[root@localhost ~]# sysctl -a|grep vm.max_map_count
vm.max_map_count = 262144
下次启动这个设置会丢失,我们把它写入配置文件:
vim /etc/sysctl.conf
vm.max_map_count=262144  #添加这一行

Q5:ElasticSearch5监听外网端口
A5:


cp /etc/elasticsearch/elasticsearch.yml /usr/share/elasticsearch/config/elasticsearch.yml
vim /usr/share/elasticsearch/config/elasticsearch.yml
network.host: 192.168.1.222
http.port: 9200
discovery.zen.minimum_master_nodes: 1 #这里设为1, 设3的话会导致Kibana报错
5. 插件plugins
- ik官网最新git
解压到~/elasticsearch/plugins/ik中即可

参考鸣谢:
1.http://git.malu.me/%E6%9E%84%E5%BB%BAELK+Redis%E6%97%A5%E5%BF%97%E5%88%86%E6%9E%90%E7%B3%BB%E7%BB%9F/
2.https://www.elastic.co/downloads/elasticsearch

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值