首页 > 技术文章 > es5.0安装问题

liqing1009 2016-11-07 14:46 原文

ES的5.0版本听说在性能上大大优化,于是老大说准备换5.0版本。由于在技术群看到很多人都说ES 5.0 安装有问题,在这里贴出自己在使用最新版5.0遇到的问题和解决方法

1、Elasticsearch 的插件: 现在marvel等插件都包含在x-pack的插件中,可通过以下命令安装:

 

[plain] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. ./bin/elasticsearch-plugin install x-pack  

 

注意:安装了x-pack后,es会包含security模块,因此不能再直接访问,而是需要通过用户名和密码才能访问,这点很不一样,详细未曾深究,已经将x-pack去掉

2、安装出现的错误一: max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]

  解决方法:切换到root用户,进入vi /etc/security/limits.conf  ,增加配置(保存后注意切回work用户的时候才能生效,sudo 修改的不能立即生效):

 

[plain] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. work soft nofile 819200  
  2. work hard nofile 819200  

 

3、安装错误二: max number of threads [1024] for user [work] likely too low, increase to at least [2048]

 

解决方法:进入limits.d下的配置文件:vi /etc/security/limits.d/90-nproc.conf ,修改配置如下:

 

[plain] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. *          soft    nproc     1024  
  2. 修改为:  
  3. *          soft    nproc     2048  


4、安装错误三: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

 

 

解决方法:修改sysctl文件:vi /etc/sysctl.conf ,增加下面配置项:

 

[plain] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. 增加改行配置:vm.max_map_count=655360  
  2. 保存退出后,执行:  
  3. sysctl -p  


4、另外再配置ES的时候,threadpool.bulk.queue_size 已经变成了thread_pool.bulk.queue_size ,ES_HEAP_SIZE,ES_MAX_MEM等配置都变为ES_JAVA_OPTS这一配置项,如限制内存最大最小为1G:

 

 

[plain] view plain copy
 
 在CODE上查看代码片派生到我的代码片
    1. export ES_JAVA_OPTS="-Xms1g -Xmx1g"  

推荐阅读