ElasticSearch下载与安装

本文涉及的产品
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介: ElasticSearch下载与安装

ElasticSearch 下载与安装

前言

官网:https://www.elastic.co/cn/

下载:https://www.elastic.co/cn/downloads/elasticsearch

文档:https://www.elastic.co/guide/index.html

图形化界面地址:https://github.com/mobz/elasticsearch-head


下载与安装

需要安装 JDK


Windows 安装

下载后解压即是安装


进入解压目录,进入 bin 目录,双击 elasticsearch.bat 即可开启服务

在浏览器访问 http:// IP:9200 即可访问

访问测试

image.png



Linux 安装

需要安装 JDK

下载后解压即是安装,进入解压目录

ElasticSearch 不支持使用 root 权限运行,需要创建一个用户并授权 ES 目录给这个用户

# 添加用户
useradd elk
# 给用户设置密码
passwd elk
# 更改目录所有者
chown -R elk /usr/local/apps/es/
# 目录下文件权限配置
chmod -R 755 /usr/local/apps/es/
# 切换 elk 用户
su elk
# 执行 bin/elasticsearch 即可
./bin/elasticsearch
# 后台启动
./bin/elasticsearch -d


ElasticSearch 启动异常及其解决方案:参考链接


简单配置用于解决 ElaticSearch 启动异常

1.修改 /etc/security/limits.conf 文件,在文件后面添加如下信息

* soft nproc 4096
* hard nproc 4096
* soft nofile 65536
* hard nofile 65536
#* soft memlock unlimited
#* hard memlock unlimited


2.修改 /etc/sysctl.conf 文件,在文件后面添加如下信息,添加后执行 sysctl -p 使其生效

vm.max_map_count=262144


3.修改 config/elasticsearch.yml 文件(注意:这里部署单个节点是修改为 [“node-1”])

#cluster.initial_master_nodes: ["node-1", "node-2"]
cluster.initial_master_nodes: ["node-1"]


4.修改 config/elasticsearch.yml 文件,修改 network.host: 0.0.0.0,可以通过 IP:9200 访问到 ES 服务

#network.host: 192.168.0.1
network.host: 0.0.0.0


Docker 安装

官方链接:https://www.docker.elastic.co/#

# 下载
docker pull docker.elastic.co/elasticsearch/elasticsearch:版本号
# 运行
docker run  -di -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:版本号


Docker 安装后需要和Linux安装一样配置


ES 图形化界面安装

Kibana安装

Kibana 安装参考:https://www.elastic.co/cn/downloads/kibana


谷歌浏览器插件安装

搜索 ElasticSearch Head ,安装即可


源码安装

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm run start
# open http://localhost:9100/


Docker 安装

for Elasticsearch 5.x: docker run -p 9100:9100 mobz/elasticsearch-head:5
for Elasticsearch 2.x: docker run -p 9100:9100 mobz/elasticsearch-head:2
for Elasticsearch 1.x: docker run -p 9100:9100 mobz/elasticsearch-head:1
for fans of alpine there is mobz/elasticsearch-head:5-alpine
# open http://localhost:9100/


本地代理

npm install
npm run proxy
npm install -g grunt-cli
grunt server
# 配置 ElasticSearch 配置文件,允许跨域访问
http.cors.enabled: true
http.cors.allow-origin: "*"
# open http://localhost:9100


相关实践学习
利用Elasticsearch实现地理位置查询
本实验将分别介绍如何使用Elasticsearch7.10版本进行全文检索、多语言检索和地理位置查询三个Elasticsearch基础检索子场景的实现。
ElasticSearch 入门精讲
ElasticSearch是一个开源的、基于Lucene的、分布式、高扩展、高实时的搜索与数据分析引擎。根据DB-Engines的排名显示,Elasticsearch是最受欢迎的企业搜索引擎,其次是Apache Solr(也是基于Lucene)。 ElasticSearch的实现原理主要分为以下几个步骤: 用户将数据提交到Elastic Search 数据库中 通过分词控制器去将对应的语句分词,将其权重和分词结果一并存入数据 当用户搜索数据时候,再根据权重将结果排名、打分 将返回结果呈现给用户 Elasticsearch可以用于搜索各种文档。它提供可扩展的搜索,具有接近实时的搜索,并支持多租户。
目录
相关文章
|
21天前
Elasticsearch安装配置文件
Elasticsearch安装配置文件
16 0
|
2天前
|
Linux Python
【Elasticsearch】linux使用supervisor常驻Elasticsearch,centos6.10安装 supervisor
【Elasticsearch】linux使用supervisor常驻Elasticsearch,centos6.10安装 supervisor
9 3
|
6天前
|
自然语言处理 搜索推荐
在Elasticsearch 7.9.2中安装IK分词器并进行自定义词典配置
在Elasticsearch 7.9.2中安装IK分词器并进行自定义词典配置
11 1
|
21天前
|
安全
【Elasticsearch6】安装笔记
【Elasticsearch6】安装笔记
17 2
|
21天前
|
网络协议 Java
elasticsearch7.1 安装启动报错
elasticsearch7.1 安装启动报错
16 1
|
21天前
|
自然语言处理 数据可视化 Linux
ElasticSearch安装ik分词器_使用_自定义词典
ElasticSearch安装ik分词器_使用_自定义词典
18 1
|
22天前
|
存储 自然语言处理 网络协议
【elastic search】下载安装、使用教程
【elastic search】下载安装、使用教程
25 1
|
6天前
|
Windows
Windows安装Elasticsearch 7.9.2
Windows安装Elasticsearch 7.9.2
7 0
|
6天前
Elasticsearch下载
Elasticsearch下载
6 0
|
7天前
|
Java API 索引
必知的技术知识:Elasticsearch和Kibana安装
必知的技术知识:Elasticsearch和Kibana安装