[工具]Centos7安装ElasticSearch5.5

来源:互联网 发布:php魔术方法有哪些 编辑:程序博客网 时间:2024/05/22 04:46

什么是ElasticSearch?

ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,并作为Apache许可条款下的开放源码发布,是当前流行的企业级搜索引擎。设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便。

ElasticSearch安装

环境
Centos7
ElasticSearch5.5 地址:https://www.elastic.co/downloads/elasticsearch

首先下载好ES的tar包,然后拷贝到linux上面,我习惯装在usr/local/这个文件夹下,所以把tar包拷贝到这里,然后解压。
解压完成后,理论上安装已经完成了。
到es文件夹的bin目录下启动./elasticsearch
注意:启动es的时候,不能用root用户来启动,需新建一个普通用户来启动它。

错误解决

ERROR: bootstrap checks failed

切换到root用户,编辑limits.conf 添加类似如下内容

vi /etc/security/limits.conf

添加如下内容:

  • soft nofile 65536

  • hard nofile 131072

  • soft nproc 2048

  • hard nproc 4096

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

切换到root用户修改配置sysctl.conf

vi /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sysctl -p

然后,重新启动elasticsearch,即可启动成功。

完成

一般这几个问题解决之后,就可以正常启动了,启动完成后,访问
localhost:9200就可以看到成果,如图:
这里写图片描述

原创粉丝点击