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 : 指定了存储文档数据目录
相关推荐
MacroZheng16 小时前
横空出世!MyBatis-Plus 同款 ES ORM 框架,用起来够优雅!
java·后端·elasticsearch
Elasticsearch2 天前
平衡尺度:利用权重使倒数排序融合 (RRF) 更加智能
elasticsearch
muyun28003 天前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
hashiqimiya3 天前
centos配置环境变量jdk
linux·运维·centos
百锦再3 天前
[特殊字符] Python在CentOS系统执行深度指南
开发语言·python·plotly·django·centos·virtualenv·pygame
在未来等你3 天前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试
半梦半醒*3 天前
正则表达式
linux·运维·开发语言·正则表达式·centos·运维开发
在未来等你4 天前
Elasticsearch面试精讲 Day 18:内存管理与JVM调优
大数据·分布式·elasticsearch·搜索引擎·面试
Elasticsearch4 天前
在 Elastic Observability 中使用 Discover 的追踪获取更深入的应用洞察
elasticsearch
婲落ヽ紅顏誶4 天前
测试es向量检索
大数据·elasticsearch·搜索引擎