Elasticsearch 快照/存储库

时间:2021-02-12 13:56:27

标签: elasticsearch nest

我知道可以在 config yml 文件中设置 repo 路径:

path.repo: C:\repo

并且无法动态完成更改存储库。

Put 快照存储库 API 是什么: https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-register-repository.html

我尝试使用 NEST 包装器使用此 api 设置一个存储库:

await this.elasticClient.Snapshot.CreateRepositoryAsync(new CreateRepositoryRequest("repoName")).ConfigureAwait(false);

await this.elasticClient.Snapshot.CreateRepositoryAsync("repoName", x => x.FileSystem(f => f.Settings(backupLocation))).ConfigureAwait(false);

都失败了。我真的不明白这应该如何工作。 如何在运行时设置/更改存储库?重启ES不是问题...

1 个答案:

答案 0 :(得分:0)

path.repo: C:\\repo

path.repo 是允许 Elasticsearch 创建存储库的位置的允许列表。尝试在 path.repo 中指定的位置之外创建存储库将失败。

一旦在 elasticsearch.yml 中指定了 path.repo,就可以在具有 fs 的位置注册一个 .elasticClient.Snapshot.CreateRepositoryAsync(...) 快照存储库。

相关问题