0

es报错:doesn’t match any of the locations specified by path.repo

 1 year ago
source link: https://blog.51cto.com/u_13673090/5634606
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

es报错:doesn’t match any of the locations specified by path.repo

精选 原创

今日基于docker 版本的elasticsearch 7.17.3 集群配置备份时发现其配置与老版本有诸多不同,过程中也出现了如标题的报错,特此记录一下。

按照以往版本的es集群配置配置后,设置snapshot时出现如下报错

doesn’t match any of the locations specified by path.repo

根据测试后发现是新的配置发生了变化,如下部分compose文件中es默认工作目录是/usr/share/elasticsearch,配置path.repo时,es会在工作目录中查找path.repo指定的文件夹,若不存在,则会自动创建一个。

version: "3"
services:
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
volumes:
- /opt/data/apps/backup/es_uat:/usr/share/elasticsearch/backup
environment:
- path.repo=backup

另snapshot配置中指定的location 则是相对/usr/share/elasticsearch/backup 目录下的文件夹名,若不存在,其也会自动创建

PUT _snapshot/es_backup
{
"type": "fs",
"settings": {
"location": "backup",
"compress": true
}
}

对于es集群配置备份需要如下步骤

1、在集群中所有节点挂载nfs 到相同路径

2、配置path.repo,注意是相对路径

3、在集群中的所有节点都正常时在kibana中配置snapshot

  • 打赏
  • 收藏
  • 评论
  • 分享
  • 举报

上一篇:Win 启用ssh server


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK