Linux 安装 Elasticsearch 并配置
2021/8/6 8:05:58
本文主要是介绍Linux 安装 Elasticsearch 并配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Linux 安装 Elasticsearch 并配置
下载 Elasticsearch
Elasticsearch 下载地址https://www.elastic.co/downloads/elasticsearch
由于国外一般下载比较慢, 可以使用国内镜像:https://www.newbe.pro/tags/Mirrors/
同样还有其他开源软件可供下载:
- filebeat:https://www.newbe.pro/Mirrors/Mirrors-Filebeat/
- elasticsearch: https://www.newbe.pro/Mirrors/Mirrors-Elasticsearch/
- Kibana: https://www.newbe.pro/Mirrors/Mirrors-Kibana/
- Logstash: https://www.newbe.pro/Mirrors/Mirrors-Logstash/
- RabbitMQ: https://www.newbe.pro/Mirrors/Mirrors-RabbitMQ/
Elasticsearch Linux 安装
环境 Centos 7
首先需要到[国内镜像网站](https://mirrors.huaweicloud.com/home)
查找自己需要的 Elasticsearch 版本, 下载其压缩包, 我这边选择 elasticsearch-7.8.0-linux-x86_64.tar.gz
# 下载 Elasticsearch 压缩包 wget https://mirrors.huaweicloud.com/elasticsearch/7.8.0/elasticsearch-7.8.0-linux-x86_64.tar.gz # 解压 并 进入 es 文件夹 tar -zxvf elasticsearch-7.8.0-linux-x86_64.tar.gz && cd elasticsearch-7.8.0
配置文件
解压成功过后, 需要配置 elasticsearch.yml 文件, 才能正常对外提供服务
# 配置文件 以下内容 vim config/elasticsearch.yml # ----------------- node.name: node-1 # 一定要对应上面 node.name 设置 cluster.initial_master_nodes: ["node-1"] # network.host 设置为自己的ip地址 也可以设置成0.0.0.0(代表所有ip可以访问) network.host: 127.0.0.1 http.port: 9200 # 在最后加上这两句,要不然,外面浏览器就访问不了哈 http.cors.enabled: true http.cors.allow-origin: "*" # -----------------
启动 elasticsearch
elasticsearch.yml 文件配置完成过后, 就可以使用命令 ./bin/elasticsearch
尝试启动
打印信息结果出来 publish_address
, bound_addresses
提供服务 ip 与 端口, started
以启动字样, 意味着启动成功
[2021-08-05T22:24:12,149][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {192.168.20.182:9200}, bound_addresses {0.0.0.0:9200} [2021-08-05T22:24:12,150][INFO ][o.e.n.Node ] [node-1] started [2021-08-05T22:24:12,936][INFO ][o.e.l.LicenseService ] [node-1] license [2425391e-58ad-4212-8216-556f416a3a8a] mode [basic] - valid [2021-08-05T22:24:12,939][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [node-1] Active license is now [BASIC]; Security is disabled [2021-08-05T22:24:12,962][INFO ][o.e.g.GatewayService ] [node-1] recovered [3] indices into cluster_state [2021-08-05T22:24:15,378][INFO ][o.e.c.r.a.AllocationService] [node-1] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[material_pass_category][1]]]).
这篇关于Linux 安装 Elasticsearch 并配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-30[译]漫画SELinux概念
- 2024-03-29linux 移动文件
- 2024-03-28linux .so file
- 2024-03-28Linux 磁盘管理
- 2024-03-28Linux学习笔记(十三)磁盘管理(一):磁盘分区
- 2024-03-26linux 创建 文件
- 2024-03-25使用SecureCRT对Linux vim进行颜色设置
- 2024-03-202019-2020-12 20199317 《Linux内核原理与分析》 第十二周作业
- 2024-03-20Linux运维的第二周总结
- 2024-03-13how to count number of directories in linux