码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu安装elasticsearch

时间:2018-04-27 15:41:03      阅读:1394      评论:0      收藏:0      [点我收藏+]

标签:htm   host   chown   阿里   max   通用   tor   href   端口   

0x00安装jdk

ElasticSearch需要安装jdk1.8以上版本的支持,所以需要先安装jdk。linux下如何安装可以查看另一篇博客

0x01 下载elasticsearch

es官网下载tar版本

直接使用wget命令

wget  https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz 

技术分享图片

使用tar -zxvf 压缩包名 解压缩

注意:启动elasticsearch的时候必须要切换成普通用户,不然会报错
技术分享图片

chown -R elastic:elastic /home/es/elasticsearch-5.5.2/

给予足够的权限,不然会报错Exception in thread "main" java.nio.file.AccessDeniedException: /usr/local/elasticsearch-6.2.2/config/jvm.options

0x03配置外部访问

进行安装目录的config目录下,修改elasticsearch.yml文件,修改点如下(要去掉#号注释)

network.host:0.0.0.0 
http.port:9200

0x04修改重启后出现俩个问题

[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

技术分享图片

1.max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

修改/etc/security/limits.conf,添加或者修改如下(切换root用户)

*  hard  nofile  65536
*  soft   nofile  65536

技术分享图片

2.[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

技术分享图片

最后可以成功访问,如果是在阿里云记得要在安全端口配置中把9200给添加进去
技术分享图片

技术分享图片

如果出现内存不足的话,可能是本机内存不足了

ubuntu安装elasticsearch

标签:htm   host   chown   阿里   max   通用   tor   href   端口   

原文地址:https://www.cnblogs.com/dycsy/p/8886517.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!