elasticsearch-7.17.29 集群案例
官网文档
Install Elasticsearch with .zip on Windows | Elasticsearch Guide [7.17] | Elastic
一 下载
1.最新版本
Download Elasticsearch | Elastic
2不同版本的
Past Releases of Elastic Stack Software | Elastic
二、集群角色与节点规划
节点类型 | 数量 | 硬件配置 | 主要职责 | 节点命名 |
---|---|---|---|---|
Master 节点 | 3 | 8C 16G | 集群元数据管理、主节点选举、集群状态维护 | master-01、master-02、master-03 |
Data 节点 | 3 | 16C 32G | 数据存储、索引分片、搜索计算 | data-01、data-02、data-03 |
ingest节点 节点 | 1 | 8C 16G | 数据预处理、请求路由、负载均衡 | ingest-01、ingest-02 [跟你需求添加] |
路由节点 | 1 | 8 核 / 16GB / 无数据盘 | (空角色,仅协调节点) | route-01 |
三、网络规划
节点类型 | 节点名称 | IP 地址 | 端口规划 |
---|---|---|---|
Master 节点 | master-01 | 192.168.1.105 | 9200 (HTTP)、9300 (节点间通信) |
Master 节点 | master-02 | 192.168.1.106 | 9200 (HTTP)、9300 (节点间通信) |
Master 节点 | master-03 | 192.168.1.107 | 9200 (HTTP)、9300 (节点间通信) |
Data 节点 | data-01 | 192.168.1.100 | 9200 (HTTP)、9300 (节点间通信) |
Data 节点 | data-02 | 192.168.1.101 | 9200 (HTTP)、9300 (节点间通信) |
Data 节点 | data-03 | 192.168.1.102 | 9200 (HTTP)、9300 (节点间通信) |
Ingest 节点 | ingest-01 | 192.168.1.108 | 9200 (HTTP)、9300 (节点间通信) |
Ingest 节点 | ingest-02 | 192.168.1.109 | 9200 (HTTP)、9300 (节点间通信) |
四、目录规划(所有节点统一)
目录路径 | 用途 | 权限 | 大小建议 |
---|---|---|---|
/home/es/elasticsearch-7.17.29 | 程序安装目录 | es:es | 10GB |
/home/es/data/data | 数据存储目录 | es:es | Data 节点:500GB+,其他节点:50GB+ |
/home/es/data/logs | 日志目录 | es:es | 100GB+ |
/home/es/elasticsearch-7.17.29/config/ | 配置文件目录 | es:es | 1GB |
/home/es/data/backups | 快照备份目录 | es:es | 视数据量而定 |
五、JVM 配置(jvm.options)
节点类型 | 配置内容 | 说明 |
---|---|---|
Master 节点 | -Xms8g -Xmx8g | 堆内存设置为物理内存的 50%,不超过 31GB |
Data 节点 | -Xms16g -Xmx16g | 堆内存设置为物理内存的 50%,不超过 31GB |
Ingest 节点 | -Xms8g -Xmx8g | 堆内 |
六、系统优化配置
配置项 | 配置内容 | 配置文件 |
---|---|---|
文件描述符限制 | es soft nofile 65536 es hard nofile 65536 | /etc/security/limits.conf |
内存锁定 | es soft memlock unlimited es hard memlock unlimited | /etc/security/limits.conf |
最大进程数 | es soft nproc 4096 es hard nproc 4096 | /etc/security/limits.conf |
虚拟内存 | vm.max_map_count=262144 | /etc/sysctl.conf |
禁用 swap | vm.swappiness=1 | /etc/sysctl.conf |
网络优化 | net.core.somaxconn=65535 net.ipv4.tcp_max_syn_backlog=65535 | /etc/sysctl.conf |
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
echo "* soft nproc 4096" >> /etc/security/limits.conf
echo "* hard nproc 4096" >> /etc/security/limits.conf
echo "* soft memlock unlimited" >> /etc/security/limits.conf
echo "* hard memlock unlimited" >> /etc/security/limits.confecho "vm.max_map_count = 262144" >> /etc/sysctl.conf
echo "vm.swappiness=1" >> /etc/sysctl.conf
echo "net.core.somaxconn=65535" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog=65535" >> /etc/sysctl.conf
sysctl -p
七、部署步骤
-
环境准备
- 所有节点安装 JDK 11(Elasticsearch 7.x 推荐版本)
- 配置主机名解析(/etc/hosts)
- 关闭防火墙或开放必要端口
- 禁用 SELinux
-
安装 Elasticsearch
- 所有节点统一安装 7.17.29 版本
- 创建专用用户 es 并设置权限
- 按照目录规划创建相关目录并授权
-
配置文件部署
- 根据节点类型部署对应的 elasticsearch.yml 配置文件
- 配置 jvm.options 文件设置堆内存
- 应用系统优化配置并重启生效
-
集群启动
- 先启动 3 个 master 节点
- 待 master 节点集群稳定后启动 data 节点
- 最后启动 ingest 节点
八、监控与维护
-
监控配置
- 部署 Elasticsearch Monitoring 收集集群指标
- 配置日志聚合(如使用 Filebeat 收集 ES 日志)
- 设置关键指标告警(集群健康状态、磁盘使用率、节点存活等)
-
备份策略
- 配置快照仓库(如 NFS 共享存储)
- 设置定时快照任务(每日凌晨执行)
- 定期验证快照可恢复性
-
日常维护
- 监控磁盘使用率,保持至少 20% 空闲空间
- 定期检查分片均衡状态
- 根据业务增长调整分片配置
该方案充分考虑了集群的高可用性、性能和可扩展性,3 个 master 节点确保集群元数据服务稳定,3 个 data 节点提供充足的存储和计算能力,1 个 ingest 节点专门处理数据预处理和1个请求路由,适合中大规模的生产环境使用。
第七、部署详细步骤
7.1 master节点配置
1. master-01-192.168.1.105节点elasticsearch.yml
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: master-01-192.168.1.105
# 节点角色配置(仅作为master节点)
node.roles: [master]
# 网络配置
network.host: 192.168.1.105
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 主节点选举配置
discovery.zen.minimum_master_nodes: 2 # (master节点数/2)+1,确保脑裂防护
cluster.fault_detection.leader_check.interval: 10s
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 最大并发恢复数
cluster.routing.allocation.node_concurrent_recoveries: 2
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
jvm.options
-Xms16g
-Xmx16g
一下是master节点的配置
discovery.seed_hosts和cluster.initial_master_nodes只配置master集群的节点就可以不用配置data和ingest以及其他节点
2. master-01-192.168.1.106节点elasticsearch.yml
[es@localhost ~]$ cat elasticsearch-7.17.29//config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: master-02-192.168.1.106
# 节点角色配置(仅作为master节点)
node.roles: [master]
# 网络配置
network.host: 192.168.1.106
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 主节点选举配置
discovery.zen.minimum_master_nodes: 2 # (master节点数/2)+1,确保脑裂防护
cluster.fault_detection.leader_check.interval: 10s
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 最大并发恢复数
cluster.routing.allocation.node_concurrent_recoveries: 2
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
3.master-03-192.168.1.107节点elasticsearch.yml
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: master-03-192.168.1.107
# 节点角色配置(仅作为master节点)
node.roles: [master]
# 网络配置
network.host: 192.168.1.107
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 主节点选举配置
discovery.zen.minimum_master_nodes: 2 # (master节点数/2)+1,确保脑裂防护
cluster.fault_detection.leader_check.interval: 10s
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 最大并发恢复数
cluster.routing.allocation.node_concurrent_recoveries: 2
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
4 分别启动各自master服务和观察日志
[es@localhost ~]$ ./elasticsearch-7.17.29/bin/elasticsearch -d[es@localhost ~]$ tail -f data/logs/jettech-elasticsearch-cluster.log
5. 查看状态和集群信息
[root@localhost es]# curl -X GET "http://192.168.1.105:9200/_cat/nodes?v"
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.1.105 2 65 0 0.00 0.04 0.08 m - master-01-192.168.1.105
192.168.1.107 2 65 0 0.00 0.05 0.12 m - master-03-192.168.1.107
192.168.1.106 3 65 0 0.00 0.04 0.10 m * master-02-192.168.1.106
[root@localhost es]# curl -X GET "http://192.168.1.105:9200/?pretty"
{"name" : "master-01-192.168.1.105","cluster_name" : "jettech-elasticsearch-cluster","cluster_uuid" : "BkyGmY6DQLiCW2pW_74QYw","version" : {"number" : "7.17.29","build_flavor" : "default","build_type" : "tar","build_hash" : "580aff1a0064ce4c93293aaab6fcc55e22c10d1c","build_date" : "2025-06-19T01:37:57.847711500Z","build_snapshot" : false,"lucene_version" : "8.11.3","minimum_wire_compatibility_version" : "6.8.0","minimum_index_compatibility_version" : "6.0.0-beta1"},"tagline" : "You Know, for Search"
}
可以看到没有数据节点 3个都是master节点目前角色
[root@localhost es]# curl -X GET "http://192.168.1.105:9200/_cluster/health?pretty"
{"cluster_name" : "jettech-elasticsearch-cluster","status" : "red","timed_out" : false,"number_of_nodes" : 3,"number_of_data_nodes" : 0,"active_primary_shards" : 0,"active_shards" : 0,"relocating_shards" : 0,"initializing_shards" : 0,"unassigned_shards" : 3,"delayed_unassigned_shards" : 0,"number_of_pending_tasks" : 0,"number_of_in_flight_fetch" : 0,"task_max_waiting_in_queue_millis" : 0,"active_shards_percent_as_number" : 0.0
}
7.2 data节点配置
1.data-01-192.168.1.100
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: data-01-192.168.1.100
# 节点角色配置(仅作为master节点)
node.roles: [data]
# 网络配置
network.host: 192.168.1.100
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
2.data-02-192.168.1.101
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: data-02-192.168.1.101
# 节点角色配置(仅作为master节点)
node.roles: [data]
# 网络配置
network.host: 192.168.1.101
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
3.data-03-192.168.1.102
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: data-03-192.168.1.102
# 节点角色配置(仅作为master节点)
node.roles: [data]
# 网络配置
network.host: 192.168.1.102
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
4 验证
[root@localhost es]# curl -X GET "http://192.168.1.105:9200/_cat/nodes?v"
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.1.105 4 65 0 0.00 0.01 0.05 m - master-01-192.168.1.105
192.168.1.107 4 65 0 0.00 0.01 0.05 m - master-03-192.168.1.107
192.168.1.102 4 63 0 0.20 0.36 0.20 d - data-03-192.168.1.102
192.168.1.106 5 66 0 0.00 0.01 0.05 m * master-02-192.168.1.106
192.168.1.100 2 63 0 0.17 0.38 0.23 d - data-01-192.168.1.100
192.168.1.101 4 63 0 0.14 0.32 0.20 d - data-02-192.168.1.101
7.3 ingest-01-192.168.1.108节点配置
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: ingest-01-192.168.1.108
# 节点角色配置(仅作为master节点)
node.roles: [ingest]
# 网络配置
network.host: 192.168.1.108
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
7.4 coordinating-01-192.168.1.109 节点配置 输入路由节点
[es@localhost ~]$ cat elasticsearch-7.17.29/config/elasticsearch.yml
# 集群名称(所有节点必须一致)
cluster.name: jettech-elasticsearch-cluster
# 节点名称(每个节点唯一)
node.name: coordinating-01-192.168.1.109
# 节点角色配置(仅作为master节点)
node.roles: []
# 网络配置
network.host: 192.168.1.109
http.port: 9200
transport.tcp.port: 9300
# 发现与集群形成配置
discovery.seed_hosts: ["192.168.1.105:9300","192.168.1.106:9300","192.168.1.107:9300"]
# 初始主节点(集群首次启动时选举使用)
cluster.initial_master_nodes: ["master-01-192.168.1.105","master-02-192.168.1.106","master-03-192.168.1.107"]
# 内存锁定(防止swap,需配合系统配置)
bootstrap.memory_lock: true
# 备份仓库路径
path.repo: ["/home/es/data/backups"]
# 日志配置
logger.org.elasticsearch.discovery: WARN
#数据存储位置
path.data: /home/es/data/data
#日志存储位置
path.logs: /home/es/data/logs
ingest.geoip.downloader.enabled: false
#不开启认证
xpack.security.enabled: false
# 跨域配置(如需前端访问)
http.cors.enabled: true
http.cors.allow-origin: "*"
http.max_content_length: 1024mb
# 传输层优化(节点间通信)
transport.tcp.compress: true
transport.tcp.keep_alive: true
验证
[root@localhost es]# curl -X GET "http://192.168.1.105:9200/_cat/nodes?v" | sort -r% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 962 100 962 0 0 13227 0 --:--:-- --:--:-- --:--:-- 13361
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.1.109 2 65 32 1.08 0.28 0.13 - - coordinating-01-192.168.1.109
192.168.1.108 2 65 17 0.45 0.16 0.10 i - ingest-01-192.168.1.108
192.168.1.107 4 66 0 0.00 0.01 0.05 m - master-03-192.168.1.107
192.168.1.106 6 66 0 0.00 0.01 0.05 m * master-02-192.168.1.106
192.168.1.105 4 66 0 0.01 0.03 0.05 m - master-01-192.168.1.105
192.168.1.102 4 63 0 0.00 0.04 0.11 d - data-03-192.168.1.102
192.168.1.101 4 63 0 0.05 0.07 0.12 d - data-02-192.168.1.101
192.168.1.100 1 63 0 0.00 0.04 0.11 d - data-01-192.168.1.100
1.健康
curl -X GET "http://192.168.1.100:9200/_cluster/health?pretty"
2. 节点数
curl -X GET "http://192.168.1.100:9200/_cat/nodes?v"
3 集群基本信息
curl -X GET "http://192.168.1.100:9200/?pretty"
4.创建索引
curl -X PUT "http://192.168.1.100:9200/user?pretty" -H "Content-Type: application/json" -d '
{"settings": {"number_of_shards": 1,"number_of_replicas": 1},"mappings": {"properties": {"name": { "type": "text" },"age": { "type": "integer" },"city": { "type": "keyword" }}}
}'
5.查看索引
curl -X GET "http://192.168.1.100:9200/_cat/indices?v"
curl -X GET "http://192.168.1.100:9200/user?pretty"
curl -X GET "http://192.168.1.100:9200/_all?pretty"6 修改副本数
curl -X PUT "http://192.168.1.100:9200/user/_settings?pretty" -H "Content-Type: application/json" -d '
{"number_of_replicas": 2
}'7.删除索引
curl -X DELETE "http://192.168.1.100:9200/user?pretty"8. 创建文档
curl -X PUT "http://192.168.1.100:9200/user/_doc/1?pretty" -H "Content-Type: application/json" -d '
{"name": "张三","age": 25,"city": "北京"
}'9.查看文档
curl -X GET "http://192.168.1.100:9200/user/_doc/1?pretty"10.批量插入创建文档
curl -X POST "http://192.168.1.100:9200/_bulk?pretty" -H "Content-Type: application/json" -d '
{"index": {"_index": "user", "_id": "3"}}
{"name": "王五", "age": 28, "city": "广州"}
{"create": {"_index": "user", "_id": "4"}}
{"name": "赵六", "age": 35, "city": "深圳"}
{"update": {"_index": "user", "_id": "3"}}
{"doc": {"age": 29}}
{"delete": {"_index": "user", "_id": "4"}}
'
11. 查看索引的所有文档数据
curl -X GET "http://192.168.1.100:9200/user/_search?pretty" -H "Content-Type: application/json" -d '
{"query": {"match_all": {}}
}'12.注册备份仓库
curl -X PUT "http://192.168.1.100:9200/_snapshot/jettech_es_backup_repo" -H 'Content-Type: application/json' -d'
{"type": "fs","settings": {"location": "/home/es/data/backups","compress": true}
}'13.创建快照
curl -X PUT "http://192.168.1.100:9200/_snapshot/jettech_es_backup_repo/snapshot_$(date +%Y%m%d)" -H 'Content-Type: application/json' -d'
{"indices": "*","ignore_unavailable": true,"include_global_state": true
}'
14.查看所有快照
curl "http://192.168.1.100:9200/_snapshot/jettech_es_backup_repo/_all?pretty"
15.查看特定快照状态
curl "http://192.168.1.100:9200/_snapshot/jettech_es_backup_repo/snapshot_20250903?pretty"16.查看快照进度
curl "http://192.168.1.100:9200/_snapshot/jettech_es_backup_repo/snapshot_20250903/_status?pretty"17.恢复索引
curl -X POST "http://192.168.1.100:9200/_snapshot/jettech_es_backup_repo/snapshot_20250903/_restore?pretty"
18.关闭现有冲突索引(保留现有数据)
curl -X POST "http://192.168.1.100:9200/.ds-.logs-deprecation.elasticsearch-default-2025.09.03-000001/_close?pretty"
curl -X POST "http://192.168.1.100:9200/.ds-ilm-history-5-2025.09.03-000001/_close?pretty"
18 打开
curl -X POST "http://192.168.1.100:9200/.ds-.logs-deprecation.elasticsearch-default-2025.09.03-000001/_open?pretty"6
curl -X GET "http://192.168.1.100:9200/_cat/shards?v"