📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8.9

简而言之,当 Elasticsearch 无法找到任何可执行命令时,会发生此错误。这可能是由于命令行语法错误、配置文件丢失或命令不正确所致。要解决此问题,您可以检查命令的语法,确保配置文件位于正确的位置并且格式正确,或者验证您尝试执行的命令是有效且受 Elasticsearch 支持的。

日志上下文 #

日志 “No commands” 的类名是 AllocationCommands.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考:

public static AllocationCommands fromXContent(XContentParser parser) throws IOException {
    AllocationCommands commands = new AllocationCommands();
    XContentParser.Token token = parser.currentToken();
    if (token == null) {
        throw new ElasticsearchParseException("No commands");
    }
    if (token == XContentParser.Token.FIELD_NAME) {
        if (parser.currentName().equals("commands") == false) {
            throw new ElasticsearchParseException("expected field name to be named [commands]; got [{}] instead", parser.currentName());
        }
    }