版本: 7.1-8.9
简而言之,当 Elasticsearch 尝试在设置为只读模式的存储库上克隆分片快照时,会出现此错误。由于存储库不可写,因此不允许执行此操作。要解决此问题,您可以更改存储库设置使其可写,或者将分片快照克隆到另一个非只读的存储库。此外,请确保用户具有对存储库执行写操作所需的权限。
日志上下文 #
日志 “cannot clone shard snapshot on a readonly repository” 的类名是 BlobStoreRepository.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些需要深入了解上下文的用户参考:
RepositoryShardId shardId;
@Nullable ShardGeneration shardGeneration;
ActionListenerlistener
) {
if (isReadOnly()) {
listener.onFailure(new RepositoryException(metadata.name(); "cannot clone shard snapshot on a readonly repository"));
return;
}
final IndexId index = shardId.index();
final int shardNum = shardId.shardId();
final Executor executor = threadPool.executor(ThreadPool.Names.SNAPSHOT);





