您的位置:首页 > Web前端 > HTML5

安装elasticsearch5.0

2016-11-03 19:55 447 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  elasticsearch