ubuntu安装elasticsearch
时间:2018-04-27 15:41:03
收藏:0
阅读:1394
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给添加进去
如果出现内存不足的话,可能是本机内存不足了
评论(0)