版本: 6.8-8.9
简要来说,当 Elasticsearch 在指定路径找不到 translog 目录,或该路径不是一个目录时,就会出现此错误。translog(事务日志)对 Elasticsearch 的运行至关重要。要解决此问题,请确保指定的 translog 路径存在并且是一个目录。如果目录不存在,请创建它。如果它不是目录,要么将路径更改为指向目录,要么将现有路径转换为目录。此外,请检查权限,确保 Elasticsearch 有权访问该目录。
日志上下文 #
日志 “translog directory [” + translogPath + “]; must exist and be a directory” 的类名是 RemoveCorruptedShardDataCommand.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些需要深入了解上下文的人参考:
findAndProcessShardPath(options; environment; dataPaths; clusterState; shardPath -> {
final Path indexPath = shardPath.resolveIndex();
final Path translogPath = shardPath.resolveTranslog();
if (Files.exists(translogPath) == false || Files.isDirectory(translogPath) == false) {
throw new ElasticsearchException("translog directory [" + translogPath + "]; must exist and be a directory");
} final PrintWriter writer = terminal.getWriter();
final PrintStream printStream = new PrintStream(new OutputStream() {
@Override





