elasticsearch 创建快照API时出错500-内部服务器错误

oewdyzsn  于 2023-08-03  发布在  ElasticSearch
关注(0)|答案(1)|浏览(357)

我们是Elasticsearch的快照和恢复功能的新手。按照下面的示例,我们尝试使用开发工具的控制台创建快照存储库。
测试中的Elasticsearch服务器作为Docker容器运行,服务使用用户名elasticsearch运行。因此,我们在用户的主目录中创建了一个文件夹,即容器中的/usr/share/elasticsearch/my_backup_location

PUT /_snapshot/my_backup
{
  "type": "fs",
  "settings": {
    "location": "/usr/share/elasticsearch/my_backup_location"
  }
}

字符串
但是,该命令不起作用,并得到一个“500-内部服务器错误”,并显示以下错误消息:

{
  "error": {
    "root_cause": [
      {
        "type": "repository_exception",
        "reason": "[my_backup] location [/usr/share/elasticsearch/my_backup_location] doesn't match any of the locations specified by path.repo because this setting is empty"
      }
    ],
    "type": "repository_exception",
    "reason": "[my_backup] failed to create repository",
    "caused_by": {
      "type": "repository_exception",
      "reason": "[my_backup] location [/usr/share/elasticsearch/my_backup_location] doesn't match any of the locations specified by path.repo because this setting is empty"
    }
  },
  "status": 500
}


我们想知道我们是否在上面的测试中遗漏了什么,并将高度赞赏任何提示和建议。
如果您需要更多信息,请告诉我们。

hjzp0vay

hjzp0vay1#

错误是
[my_backup] location [/usr/share/elasticsearch/my_backup_location]与path.repo指定的任何位置都不匹配,因为此设置为空
因此,在elasticsearch.yml配置文件中,需要添加以下行:

path.repo: /usr/share/elasticsearch/my_backup_location

字符串

相关问题