centos安装使用elasticsearch

1.首先可以在 Elasticsearch 官网 Download Elasticsearch | Elastic 下载安装包

  1. 在指定的位置(我的是/opt/zhong/)解压安装包

tar -zxvf elasticsearch-7.12.1-linux-x86_64.tar.gz

3.启动es-这种方式启动会将日志全部打印在当前页面,一旦使用 ctrl+c退出就会导致es退出。需要注意的是,无论是何种启动方式,都不可以使用root用户启动es。

bin/elasticsearch

或者

./bin/elasticsearch

  1. 后台启动es

bin/elasticsearch -d

或者

./bin/elasticsearch -d

5.查看是否启动成功

curl localhost:9200

或者

ps -ef | grep elasticsearch

  • name : 默认启动的时候指定了 ES 实例名称,name 为 BYSocketdeMacBook-Pro-2.local
  • cluster_name : 默认名为 elasticsearch
  • version :版本信息
  1. 停止es

首先通过ps命令好到es的进程号

ps -ef | grep elasticsearch

然后使用 kill [pid] 杀掉进程

kill 8720

单机集群多个 ES 实例安装

单机多个 ES 实例,形成一个 ES 单机伪集群,启动脚本如下:

bin/elasticsearch -E node.name=node01 -E cluster.name=bysocket_es_cluster -E path.data=node01_data -d

bin/elasticsearch -E node.name=node02 -E cluster.name=bysocket_es_cluster -E path.data=node02_data -d

bin/elasticsearch -E node.name=node03 -E cluster.name=bysocket_es_cluster -E path.data=node03_data -d

bin/elasticsearch -E node.name=node04 -E cluster.name=bysocket_es_cluster -E path.data=node04_data -d

命令简单解释如下:

  • node.name : ES 节点名称,即实例名
  • cluster.name : ES 集群名称
  • path.data : 指定了存储文档数据目录
相关推荐
闲人编程20 小时前
Elasticsearch搜索引擎集成指南
python·elasticsearch·搜索引擎·jenkins·索引·副本·分片
先跑起来再说20 小时前
Git 入门到实战:一篇搞懂安装、命令、远程仓库与 IDEA 集成
ide·git·后端·elasticsearch·golang·intellij-idea
Dxy123931021621 小时前
深度解析 Elasticsearch:从倒排索引到 DSL 查询的实战突围
大数据·elasticsearch·搜索引擎
Dxy12393102161 天前
别再让 ES 把你拖垮!5 个实战技巧让搜索性能提升 10 倍
大数据·elasticsearch·搜索引擎
予枫的编程笔记1 天前
【Linux入门篇】Ubuntu和CentOS包管理不一样?apt与yum对比实操,看完再也不混淆
linux·人工智能·ubuntu·centos·linux包管理·linux新手教程·rpm离线安装
954L1 天前
CentOs7执行yum update出现链接404问题
linux·centos·yum·vault
星辰_mya1 天前
Elasticsearch线上问题之OOM
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客1 天前
使用 Groq 与 Elasticsearch 进行智能查询
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
张彦峰ZYF1 天前
一套「策略化 Elasticsearch 召回平台」架构设计思路
大数据·elasticsearch·搜索引擎
Dxy12393102162 天前
Elasticsearch 索引与映射:为你的数据打造一个“智能仓库”
大数据·elasticsearch·搜索引擎