在elasticsearch 7.3.2中的fs中创建快照时出错?

aelbi1ox  于 2022-11-22  发布在  ElasticSearch
关注(0)|答案(2)|浏览(427)

我尝试在elasticsearch中创建快照,我已在elasticsearch.yml中定义了路径.repo,正确指向文件夹elasticsearch_backup,并且它具有权限
第一个
我用的是Kibana的API-

PUT /_snapshot/elasticsearch-backup
{
  "type": "fs",
  "settings": {
    "compress": true,
    "location": "/home/ubuntu/elasticsearch-backup"
  }
}

那么我得到的错误是-

{
  "error": {
    "root_cause": [
      {
        "type": "repository_verification_exception",
        "reason": "[elasticsearch-backup] [[5_cX7DhMSw2KgPrVMEm3Gg, 'RemoteTransportException[[elastic-data-node-02][MY IP.11:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[elasticsearch-backup] a file written by master to the store [/home/ubuntu/elasticsearch-backup] cannot be accessed on the node [{elastic-data-node-02}{5_cX7DhMSw2KgPrVMEm3Gg}{KF6p34P9TSyp81QJQ56kgQ}{MY IP.11}{MY IP.11:9300}{di}{ml.machine_memory=8339873792, xpack.installed=true, ml.max_open_jobs=20}]. This might indicate that the store [/home/ubuntu/elasticsearch-backup] is not shared between this node and the master node or that permissions on the store don't allow reading files written by the master node];'], [LhHj2udCRCWy7gt5iVQMsw, 'RemoteTransportException[[elastic-data-node-01][MY IP.10:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[elasticsearch-backup] a file written by master to the store [/home/ubuntu/elasticsearch-backup] cannot be accessed on the node [{elastic-data-node-01}{LhHj2udCRCWy7gt5iVQMsw}{S1TeQwE7Sjq6B__obrDEow}{MY IP.10}{MY IP.10:9300}{di}{ml.machine_memory=8339873792, xpack.installed=true, ml.max_open_jobs=20}]. This might indicate that the store [/home/ubuntu/elasticsearch-backup] is not shared between this node and the master node or that permissions on the store don't allow reading files written by the master node];']]"
      }
    ],
    "type": "repository_verification_exception",
    "reason": "[elasticsearch-backup] [[5_cX7DhMSw2KgPrVMEm3Gg, 'RemoteTransportException[[elastic-data-node-02][MY IP.11:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[elasticsearch-backup] a file written by master to the store [/home/ubuntu/elasticsearch-backup] cannot be accessed on the node [{elastic-data-node-02}{5_cX7DhMSw2KgPrVMEm3Gg}{KF6p34P9TSyp81QJQ56kgQ}{MY IP.11}{MY IP.11:9300}{di}{ml.machine_memory=8339873792, xpack.installed=true, ml.max_open_jobs=20}]. This might indicate that the store [/home/ubuntu/elasticsearch-backup] is not shared between this node and the master node or that permissions on the store don't allow reading files written by the master node];'], [LhHj2udCRCWy7gt5iVQMsw, 'RemoteTransportException[[elastic-data-node-01][MY IP.10:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[elasticsearch-backup] a file written by master to the store [/home/ubuntu/elasticsearch-backup] cannot be accessed on the node [{elastic-data-node-01}{LhHj2udCRCWy7gt5iVQMsw}{S1TeQwE7Sjq6B__obrDEow}{MY IP.10}{MY IP.10:9300}{di}{ml.machine_memory=8339873792, xpack.installed=true, ml.max_open_jobs=20}]. This might indicate that the store [/home/ubuntu/elasticsearch-backup] is not shared between this node and the master node or that permissions on the store don't allow reading files written by the master node];']]"
  },
  "status": 500
}
wztqucjr

wztqucjr1#

这可能表示存储[/home/ubuntu/elasticsearch-backup]未在此节点和主节点之间共享,或者存储上的权限不允许阅读主节点写入的文件
如果您有多个节点,并希望使用共享文件系统存储库(fs),则需要有一个所有节点都可以访问的...共享文件系统,否则无法正常工作。
为了注册共享文件系统信息库,必须将同一共享文件系统挂载到所有主节点和数据节点上的同一位置。

u5rb5r59

u5rb5r592#

正如@瓦尔所说,该文件应该对所有节点都是可访问的,包括主节点和数据节点。
请注意,所有节点都可以访问快照装载目录(卷)。
第一个

创建存储库

PUT _snapshot/my-fs-repository
{
  "type": "fs",
  "settings": {
    "location": "/usr/share/opensearch/snapshots"
  }
}

验证存储库

POST _snapshot/my-fs-repository/_verify

以下API将创建包含所有索引和群集状态的快照

PUT _snapshot/my-fs-repository/1

检查快照状态、索引等。

GET _snapshot/my-fs-repository/1

参考:https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-filesystem-repository.html

相关问题