elasticsearch5.6查询没有elasticsearch2.3.3快,为什么

elasticsearch5.6

索引模板

curl cmserver:9200/track_20190809?pretty
{
  "track_20190809" : {
    "aliases" : { },
    "mappings" : {
      "track" : {
        "_all" : {
          "enabled" : false
        },
        "properties" : {
          "dataSource" : {
            "type" : "keyword"
          },
          "dtTime" : {
            "type" : "date"
          },
          "idtype" : {
            "type" : "keyword"
          },
          "linkId" : {
            "type" : "keyword"
          },
          "strEqpId" : {
            "type" : "keyword"
          },
          "strId" : {
            "type" : "keyword"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "creation_date" : "1566555759568",
        "number_of_shards" : "4",
        "number_of_replicas" : "0",
        "uuid" : "X0e_Xj-ERB--GJedj6hsJw",
        "version" : {
          "created" : "5061699"
        },
        "provided_name" : "track_20190809"
      }
    }
  }
}

maven

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.9.RELEASE</version>
</parent>
<dependencies>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
                <exclusions>
                <exclusion>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-logging</artifactId>
                        </exclusion>
                </exclusions>
        </dependency>
        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <dependency>
                <groupId>org.elasticsearch</groupId>
                <artifactId>elasticsearch</artifactId>
                <version>5.6.16</version>
        </dependency>
        <dependency>
                <groupId>org.elasticsearch.client</groupId>
                <artifactId>transport</artifactId>
                <version>5.6.16</version>
        </dependency>
        <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
        </dependency>
</dependencies>

客户端创建

public class ESRepository {
    public TransportClient client = null;
    public void init() throws Exception {
        buildClient();
    }
    private void buildClient() throws Exception {
        String[] hosts = { "192.168.0.82" };
        Settings settings = Settings.builder().put("cluster.name", "elasticsearch").put("client.transport.sniff", true)
                .put("client.transport.ping_timeout", "60s").put("action.auto_create_index", true).build();
        client = new PreBuiltTransportClient(settings);
        for (String strTransportHostName : hosts) {
            client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(strTransportHostName), 9300));
        }
    }
}

查询代码

public class QueryData {
    private ESRepository esr = new ESRepository();
    private int total = 0;
    public void doRun(String query) {
        try {
            esr.init();
        } catch (Exception e) {
            log.error("", e);
        }
        log.info("query data start...");
        long a = System.currentTimeMillis();
        String scrollId = getScrollId(query);
        queryByScrollId(scrollId);
        clearScroll(scrollId);
        long b = System.currentTimeMillis();
        log.info("query data end total:" + total + ", time:" + (b-a));
    }
    private void queryByScrollId(String scrollId) {
        SearchScrollRequestBuilder searchScrollRequestBuilder;
        SearchResponse response;
        int i = 0;
        while(true) {
            i++;
            searchScrollRequestBuilder = esr.client.prepareSearchScroll(scrollId);
            searchScrollRequestBuilder.setScroll(TimeValue.timeValueMinutes(5));
            response = searchScrollRequestBuilder.get();
            long count = response.getHits().getHits().length;
            log.info("--------- queryByScrollId size {}, i={}", count, i);
            total += count;
            if (count == 0) {
                break;
            } else {
                /*for (SearchHit searchHit : searchHits) {
                    log.info("--------- queryByScrollId source {}", searchHit.getSourceAsString());
                }*/
            }
            scrollId = response.getScrollId();
        }
    }
    private String getScrollId(String query) {
        BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
        if(query != null) {
            queryBuilder.must(QueryBuilders.wildcardQuery("strId", "*" + query + "*"));
        }
        SearchRequestBuilder searchRequestBuilder = esr.client.prepareSearch("track_20190809");
        searchRequestBuilder.setTypes("track");
        searchRequestBuilder.setScroll(TimeValue.timeValueMinutes(5));
        searchRequestBuilder.setSearchType(SearchType.DEFAULT);
        searchRequestBuilder.setSize(10000);
        //searchRequestBuilder.addSort(SortBuilders.fieldSort("strId"));
        if(query != null) {
            searchRequestBuilder.setQuery(queryBuilder);
        }
        SearchResponse response = searchRequestBuilder.get();
        long count = response.getHits().getHits().length;
        log.info("--------- getScrollId size {}", count);
        total += count;
        /*for (SearchHit searchHit : searchHits) {
            log.info("--------- getScrollId source {}", searchHit.getSourceAsString());
        }*/
        return response.getScrollId();
    }
    private void clearScroll(String scrollId) {
        ClearScrollRequestBuilder clearScrollRequestBuilder = esr.client.prepareClearScroll();
        clearScrollRequestBuilder.addScrollId(scrollId);
        ClearScrollResponse response = clearScrollRequestBuilder.get();
        log.info("--------- clearScroll result {}", response.isSucceeded());
    }
}

elasticsearch2.3

索引模板

curl cmserver:9200/track_20190809?pretty
{
  "track_20190809" : {
    "aliases" : { },
    "mappings" : {
      "track" : {
        "_all" : {
          "enabled" : false
        },
        "properties" : {
          "dataSource" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "dtTime" : {
            "type" : "date",
            "format" : "strict_date_optional_time||epoch_millis"
          },
          "idtype" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "linkId" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "strEqpId" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "strId" : {
            "type" : "string",
            "index" : "not_analyzed"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "creation_date" : "1566465473765",
        "number_of_shards" : "4",
        "number_of_replicas" : "0",
        "uuid" : "MfT_bzy1TO-67aVocEt5uQ",
        "version" : {
          "created" : "2030399"
        }
      }
    }
  }
}

maven

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.2.RELEASE</version>
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>2.3.3</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
    </dependencies>

客户端创建

public class ESRepository {
    public TransportClient client = null;
    public void init() throws Exception {
        buildClient();
    }

    private void buildClient() throws Exception {
        String[] hosts = { "192.168.0.82" };
        Settings settings = Settings.builder().put("cluster.name", "elasticsearch").put("client.transport.sniff", true)
                .put("client.transport.ping_timeout", "60s").put("action.auto_create_index", true).build();
        client = TransportClient.builder().settings(settings).build();
        for (String strTransportHostName : hosts) {
            client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(strTransportHostName), 9300));
        }
    }
}

查询代码

和elasticsearch5.6一样

两个es内存配置都为1G,数据总条数1000万
全部查出来,5.6需要300多秒,而2.3需要130秒左右,不清楚为什么,求大神帮忙

1个回答

ren_hui_jun
寻梦csdn 这些都已经配置过了,还是不行
6 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ElasticSearch6.3.1 jdbc连接提示Original type was [request [/_xpack/sql] contains unrecognized parameter: [mode]].
在maven pom文件中添加一下: ``` <dependency> <groupId>org.elasticsearch.plugin</groupId> <artifactId>jdbc</artifactId> <version>6.3.1</version> </dependency> ``` ``` <repositories> <repository> <id>elastic.co</id> <url>https://artifacts.elastic.co/maven</url> </repository> </repositories> ``` 同时也下载了jar: https://artifacts.elastic.co/maven/org/elasticsearch/plugin/jdbc/6.3.1/jdbc-6.3.1.jar 并放入maven相关位置。 接下来准备使用jdbc连接es,代码如下: 连接es: ``` public static void startPool(String driveName, String url, String sql) throws Exception { Class.forName(driveName); Connection connection = DriverManager.getConnection(url, connectionProperties); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(sql); int num = 0; while (resultSet.next()) { num = 1; } if (num == 1) { System.out.println("es可以连接"); } else { System.out.println("es不可以连接,请重试"); } } ``` 执行: ``` public void initDBSource() throws Exception { SQLUtil.startPool( "org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcDriver",//ES jdbc驱动 "jdbc:es://http://192.168.38.12:9200",//es链接串 "SHOW tables like \\u0027data%\\u0027" //数据源连接校验sql ); } ``` 结果: ``` Exception in thread "main" java.sql.SQLException: Server sent bad type [illegal_argument_exception]. Original type was [request [/_xpack/sql] contains unrecognized parameter: [mode]]. [java.lang.IllegalArgumentException: request [/_xpack/sql] contains unrecognized parameter: [mode] at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:103) at org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:87) at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:240) at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:336) at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:174) at org.elasticsearch.http.netty4.Netty4HttpServerTransport.dispatchRequest(Netty4HttpServerTransport.java:551) at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:137) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at org.elasticsearch.http.netty4.pipelining.HttpPipeliningHandler.channelRead(HttpPipeliningHandler.java:68) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at org.elasticsearch.http.netty4.cors.Netty4CorsHandler.channelRead(Netty4CorsHandler.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:656) at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:556) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:510) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909) at java.lang.Thread.run(Thread.java:748) ] at org.elasticsearch.xpack.sql.client.shared.JreHttpUrlConnection.parserError(JreHttpUrlConnection.java:181) at org.elasticsearch.xpack.sql.client.shared.JreHttpUrlConnection.request(JreHttpUrlConnection.java:158) at org.elasticsearch.xpack.sql.client.HttpClient.lambda$post$0(HttpClient.java:101) at org.elasticsearch.xpack.sql.client.shared.JreHttpUrlConnection.http(JreHttpUrlConnection.java:62) at org.elasticsearch.xpack.sql.client.HttpClient.lambda$post$1(HttpClient.java:100) at java.security.AccessController.doPrivileged(Native Method) at org.elasticsearch.xpack.sql.client.HttpClient.post(HttpClient.java:99) at org.elasticsearch.xpack.sql.client.HttpClient.query(HttpClient.java:77) at org.elasticsearch.xpack.sql.jdbc.net.client.JdbcHttpClient.query(JdbcHttpClient.java:51) at org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcStatement.initResultSet(JdbcStatement.java:162) at org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcStatement.execute(JdbcStatement.java:153) at org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:42) at com.rh.dome.util.ESJDBCTest2.main(ESJDBCTest2.java:32) Process finished with exit code 1 ``` 不知道出现什么问题,在百度上官网上都查不到此类错误 经过一番努力,终于发现问题所在,原因是:JDBC的驱动包跟服务器上的es版本不一致。 一定要一致,哪怕版本很接近,也会出现驱动包兼容问题!!!
springboot整合elasticsearch提示org.elasticsearch.transport.NodeDisconnectedException
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId> <version>2.1.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-elasticsearch</artifactId> <version>2.1.4.RELEASE</version> </dependency> <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>2.4.0</version> </dependency> <dependency> <groupId>org.elasticsearch.plugin</groupId> <artifactId>transport-netty4-client</artifactId> <version>6.4.0</version> </dependency> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>transport</artifactId> <version>6.4.0</version> </dependency> application.yml 配置如下: spring: data: elasticsearch: cluster-nodes: 192.168.100.21:9300,192.168.100.22:9300,192.168.100.23:9300 cluster-name: wt repositories: enabled: true springboot版本1.5.8,linux安装ES版本是6.4.0,上面是工程里引入的jar,ES在浏览器能访问,且有数据,但是项目启动就连接不上 NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{192.168.100.21}{192.168.100.21:9300}, {#transport#-2}{192.168.100.22}{192.168.100.22:9300}, {#transport#-3}{192.168.100.23}{192.168.100.23:9300}] ] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:290) at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:207) at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55) at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:288)
zipkin2和Elasticsearch7.0.1整合出现的问题
![图片说明](https://img-ask.csdn.net/upload/201905/20/1558343865_955644.png)![图片说明](https://img-ask.csdn.net/upload/201905/20/1558343873_621189.png) 2019-05-20 17:03:03.673 WARN 8144 --- [cking-tasks-1-2] c.l.a.i.a.DefaultExceptionHandler : [id: 0x6bf14625, L:/192.168.5.146:9411 - R:/192.168.5.146:52483][h1c://sc-201904251550:9411/zipkin/api/v2/spans#GET] Unhandled exception from an annotated service: java.lang.IllegalStateException: response for update-template failed: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Setting index.mapper.dynamic was removed after version 6.0.0"}],"type":"illegal_argument_exception","reason":"Setting index.mapper.dynamic was removed after version 6.0.0"},"status":400} at zipkin2.elasticsearch.internal.client.HttpCall.parseResponse(HttpCall.java:151) ~[zipkin-storage-elasticsearch-2.12.9.jar!/:?] at zipkin2.elasticsearch.internal.client.HttpCall.execute(HttpCall.java:79) ~[zipkin-storage-elasticsearch-2.12.9.jar!/:?] at zipkin2.elasticsearch.EnsureIndexTemplate.apply(EnsureIndexTemplate.java:42) ~[zipkin-storage-elasticsearch-2.12.9.jar!/:?] at zipkin2.elasticsearch.ElasticsearchStorage.ensureIndexTemplates(ElasticsearchStorage.java:351) ~[zipkin-storage-elasticsearch-2.12.9.jar!/:?] at zipkin2.elasticsearch.AutoValue_ElasticsearchStorage.ensureIndexTemplates(AutoValue_ElasticsearchStorage.java:31) ~[zipkin-storage-elasticsearch-2.12.9.jar!/:?] at zipkin2.elasticsearch.ElasticsearchStorage.spanStore(ElasticsearchStorage.java:248) ~[zipkin-storage-elasticsearch-2.12.9.jar!/:?] at zipkin2.server.internal.ZipkinQueryApiV2.getSpanNames(ZipkinQueryApiV2.java:86) ~[classes!/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_211] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_211] at com.linecorp.armeria.internal.annotation.AnnotatedHttpService.invoke(AnnotatedHttpService.java:254) ~[armeria-0.83.0.jar!/:?] at com.linecorp.armeria.internal.annotation.AnnotatedHttpService.lambda$serve0$3(AnnotatedHttpService.java:241) ~[armeria-0.83.0.jar!/:?] at java.util.concurrent.CompletableFuture.uniApply(Unknown Source) ~[?:1.8.0_211] at java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source) ~[?:1.8.0_211] at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:1.8.0_211] at com.linecorp.armeria.common.AbstractRequestContext.lambda$makeContextAware$1(AbstractRequestContext.java:69) ~[armeria-0.83.0.jar!/:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_211] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_211] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.34.Final.jar!/:4.1.34.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]
ElasticSearch 6.3.2版本整合springBoot 报错 java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50)
在服务器上搭建了一个单机的ElasticSearch 版本6.3.2,因为本地访问服务器的9200端口访问不到(network.host:0.0.0.0启动报错),所以用nginx做了代理9002端口对应9200,9001端口对应9300,直接访问访问成功如下:![图片说明](https://img-ask.csdn.net/upload/202002/08/1581096007_348190.jpg)![图片说明](https://img-ask.csdn.net/upload/202002/08/1581096016_248026.png) 然后我用写了个Demo但是一直报错 java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50); 配置文件如下: ![图片说明](https://img-ask.csdn.net/upload/202002/08/1581096398_340973.jpg) ![图片说明](https://img-ask.csdn.net/upload/202002/08/1581096609_898535.jpg) 错误日志和pom.xml文件如下: ``` exception caught on transport layer [NettyTcpChannel{localAddress=/192.168.1.103:61678, remoteAddress=/xxx.xxx.xxx.xxx:9001}], closing connection io.netty.handler.codec.DecoderException: java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472) ~[netty-codec-4.1.31.Final.jar:4.1.31.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) ~[netty-codec-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241) [netty-handler-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:548) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:502) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) [netty-transport-4.1.31.Final.jar:4.1.31.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) [netty-common-4.1.31.Final.jar:4.1.31.Final] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191] Caused by: java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50) at org.elasticsearch.transport.TcpTransport.validateMessageHeader(TcpTransport.java:1315) ~[elasticsearch-6.3.2.jar:6.4.3] at org.elasticsearch.transport.netty4.Netty4SizeHeaderFrameDecoder.decode(Netty4SizeHeaderFrameDecoder.java:36) ~[transport-netty4-client-6.4.3.jar:6.4.3] at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) ~[netty-codec-4.1.31.Final.jar:4.1.31.Final] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) ~[netty-codec-4.1.31.Final.jar:4.1.31.Final] ... 19 common frames omitted ``` pom.xml文件如下 ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com</groupId> <artifactId>elasticsearchtest</artifactId> <version>0.0.1-SNAPSHOT</version> <name>elasticsearchtest</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>6.3.2</version> </dependency> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>transport</artifactId> <version>6.3.2</version> </dependency> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>6.3.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.10</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> ``` 请大神帮忙看看,谢谢啦!
求助sprinboot整合 elasticsearch-rest-high-level-client-5.6.4报错
以下是报错信息: Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.boot.autoconfigure.elasticsearch.rest.RestClientConfigurations$RestHighLevelClientConfiguration.elasticsearchRestHighLevelClient(RestClientConfigurations.java:75) The following method did not exist: org.elasticsearch.client.RestHighLevelClient.<init>(Lorg/elasticsearch/client/RestClientBuilder;)V The method's class, org.elasticsearch.client.RestHighLevelClient, is available from the following locations: jar:file:/Users/jianxiaowen/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/5.6.4/elasticsearch-rest-high-level-client-5.6.4.jar!/org/elasticsearch/client/RestHighLevelClient.class It was loaded from the following location: file:/Users/jianxiaowen/.m2/repository/org/elasticsearch/client/elasticsearch-rest-high-level-client/5.6.4/elasticsearch-rest-high-level-client-5.6.4.jar Action: Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.RestHighLevelClient 以下是pom文件,是springboot版本和这个es不兼容吗,原来用的es6.x是可以的,换成5.x就不行了,但是公司环境就要求5.x: ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xxx</groupId> <artifactId>repservice</artifactId> <version>1.0</version> <modules> <module>kg-business</module> </modules> <packaging>pom</packaging> <name>repservice</name> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.7.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <elasticsearch.version>5.6.4</elasticsearch.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>com.x x x.datanlp</groupId> <artifactId>graph-db-sdk</artifactId> <version>1.1-SNAPSHOT</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.13</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-commons</artifactId> <version>2.1.10.RELEASE</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.restdocs</groupId> <artifactId>spring-restdocs-mockmvc</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.0</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter-test</artifactId> <version>2.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifactId> <version>5.2.4</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.3</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.4.12</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.10</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.5.10</version> </dependency> <dependency> <groupId>io.reactivex.rxjava2</groupId> <artifactId>rxjava</artifactId> <version>2.2.9</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>3.6</version> </dependency> <!-- 引入 redis 依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.solr/solr-solrj --> <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-solrj</artifactId> <version>8.2.0</version> </dependency> <!-- 解压rar --> <dependency> <groupId>com.github.junrar</groupId> <artifactId>junrar</artifactId> <version>4.0.0</version> </dependency> <!-- 解压zip --> <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <version>1.10.7</version> </dependency> <!--结果验证--> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <version>2.4.0</version> </dependency> <!-- 临时--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.51</version> </dependency> <dependency> <groupId>com.arangodb</groupId> <artifactId>arangodb-java-driver</artifactId> <version>5.0.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-web --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-web</artifactId> <version>2.7</version> </dependency> <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>5.6.4</version> </dependency> <!-- Java Low Level REST Client --> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-client</artifactId> <version>5.6.4</version> </dependency> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>5.6.4</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skipTests>true</skipTests> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> ```
elasticsearch连接出错
1、错误截图 ``` 2019-12-06 10:39:43.846 ERROR 2824 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{OAnbfg_bSjCat5ebeRNMTg}{127.0.0.1}{127.0.0.1:9300}]]] with root cause org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{OAnbfg_bSjCat5ebeRNMTg}{127.0.0.1}{127.0.0.1:9300}] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:363) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54) ~[elasticsearch-5.6.1.jar:5.6.1] at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:62) ~[elasticsearch-5.6.1.jar:5.6.1] at com.imooc.service.search.SearchServiceImpl.aggregateDistrictHouse(SearchServiceImpl.java:460) ~[classes/:na] at com.imooc.web.controller.house.HouseController.show(HouseController.java:207) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.20.jar:8.5.20] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.11.RELEASE.jar:4.3.11.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.20.jar:8.5.20] ``` ![图片说明](https://img-ask.csdn.net/upload/201912/06/1575600402_940718.jpg) 2、elasticsearch配置信息 ``` cluster.name: elasticsearch # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: master node.master: true node.data: true # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # #path.data: /path/to/data # # Path to log files: # #path.logs: /path/to/logs # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # #bootstrap.memory_lock: true # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # network.host: 127.0.0.1 # # Set a custom port for HTTP: # #http.port: 9200 # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # #discovery.zen.ping.unicast.hosts: ["host1", "host2"] # # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1): # #discovery.zen.minimum_master_nodes: 3 # # For more information, consult the zen discovery module documentation. # # ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # #gateway.recover_after_nodes: 3 # # For more information, consult the gateway module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true #bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: "*" ``` 3、spring项目配置信息 ``` package com.imooc.config; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.transport.client.PreBuiltTransportClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.net.InetAddress; import java.net.UnknownHostException; @Configuration public class ElasticSearchConfig { @Value("${elasticsearch.host}") private String esHost; @Value("${elasticsearch.port}") private int esPort; @Value("${elasticsearch.cluster.name}") private String esName; @Bean public TransportClient esClient() throws UnknownHostException { Settings settings = Settings.builder() .put("cluster.name", this.esName) // .put("cluster.name", "elasticsearch") .put("client.transport.sniff", true) .build(); InetSocketTransportAddress master = new InetSocketTransportAddress( InetAddress.getByName(esHost), esPort // InetAddress.getByName("192.168.100.106"), 8999 ); TransportClient client = new PreBuiltTransportClient(settings) .addTransportAddress(master); return client; } } ``` 4、application.propertires ``` elasticsearch.cluster.name=xunwu elasticsearch.host=127.0.0.1 elasticsearch.port=9300 ```
elasticsearch插入数据报错
之前用的elasticsearch是1.3.2版本的,装了ik插件,用起来很正常,后面elasticsearch换成2.0.0的了,还装了logstash2.0.0,kibana4.2.0, ik分词器是1.5.0的,用Java代码批量插入的时候就报错了,在elasticsearch的控制台手动插入是没问题的 [INFO][2016-11-16 18:22:34] org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:151) main [Agatha Harkness] loaded [analysis-jcseg], sites [] [INFO][2016-11-16 18:22:35] org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1.handleException(TransportClientNodesService.java:443) elasticsearch[Agatha Harkness][transport_client_worker][T#1]{New I/O worker #28} [Agatha Harkness] failed to get local cluster state for [#transport#-1][USER-20150529VW][inet[localhost/127.0.0.1:9300]], disconnecting... org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream Caused by: org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:173) at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125) at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.StreamCorruptedException: Unsupported version: 1 at org.elasticsearch.common.io.ThrowableObjectInputStream.readStreamHeader(ThrowableObjectInputStream.java:46) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299) at org.elasticsearch.common.io.ThrowableObjectInputStream.<init>(ThrowableObjectInputStream.java:38) at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:170) ... 23 more [WARN][2016-11-16 18:22:35] org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:135) elasticsearch[Agatha Harkness][transport_client_worker][T#1]{New I/O worker #28} [Agatha Harkness] Message not fully read (response) for [0] handler org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1@7e8c9412, error [true], resetting [INFO][2016-11-16 18:22:39] org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:862) Thread-1 Closing org.springframework.context.support.GenericApplicationContext@fbd1f6: startup date [Wed Nov 16 18:21:55 CST 2016]; root of context hierarchy [INFO][2016-11-16 18:22:39] org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:272) Thread-1 [Fer-de-Lance] stopping ... [INFO][2016-11-16 18:22:39] org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:310) Thread-1 [Fer-de-Lance] stopped
使用elasticsearch批量插入数据报错
之前用的是elasticsearch1.3.2的版本加了ik分词器测试过是没有问题的,后来换成2.0.0版本的,同时安装了logstash2.0.0和kibana4.2.0,ik分词器是1.5.0的,然后再用Java代码运行的时候就报错,实在是看不懂 [INFO][2016-11-16 17:54:24] org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:151) main [Abdul Alhazred] loaded [analysis-jcseg], sites [] [INFO][2016-11-16 17:54:24] org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1.handleException(TransportClientNodesService.java:443) elasticsearch[Abdul Alhazred][transport_client_worker][T#1]{New I/O worker #28} [Abdul Alhazred] failed to get local cluster state for [#transport#-1][USER-20150529VW][inet[localhost/127.0.0.1:9300]], disconnecting... org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream Caused by: org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:173) at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125) at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.StreamCorruptedException: Unsupported version: 1 at org.elasticsearch.common.io.ThrowableObjectInputStream.readStreamHeader(ThrowableObjectInputStream.java:46) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299) at org.elasticsearch.common.io.ThrowableObjectInputStream.<init>(ThrowableObjectInputStream.java:38) at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:170) ... 23 more [WARN][2016-11-16 17:54:24] org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:135) elasticsearch[Abdul Alhazred][transport_client_worker][T#1]{New I/O worker #28} [Abdul Alhazred] Message not fully read (response) for [0] handler org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1@29f1fa67, error [true], resetting [INFO][2016-11-16 17:54:28] org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:862) Thread-1 Closing org.springframework.context.support.GenericApplicationContext@fbd1f6: startup date [Wed Nov 16 17:53:44 CST 2016]; root of context hierarchy [INFO][2016-11-16 17:54:28] org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:272) Thread-1 [Killer Shrike] stopping ... [INFO][2016-11-16 17:54:28] org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:310) Thread-1 [Killer Shrike] stopped
Elasticsearch 启动报错问题 显示Nodes的问题???
今天在搭建ElasticSearch时候 出现的问题 显示Nodes的问题: ``` 019-01-18 23:20:34.462 ERROR 12264 --- [ main] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{mfQlD8ZeTIOtTnLapBR5pA}{192.168.1.105}{192.168.1.105:9300}] ``` springboot版本: <version>2.1.2.RELEASE</version> springboot data elasticsearch 版本: ![图片说明](https://img-ask.csdn.net/upload/201901/18/1547825326_146679.png) properties配置文件内容如下: ``` spring.elasticsearch.jest.uris=http://192.168.1.105:9200/ spring.data.elasticsearch.cluster-name=elasticsearch spring.data.elasticsearch.cluster-nodes=192.168.1.105:9300 ``` elasticsearch 浏览器中显示如下: ``` { "name" : "Rigellian Recorder", "cluster_name" : "elasticsearch", "cluster_uuid" : "MU7QHYyfR6CoTImE1BpjEQ", "version" : { "number" : "2.4.6", "build_hash" : "5376dca9f70f3abef96a77f4bb22720ace8240fd", "build_timestamp" : "2017-07-18T12:17:44Z", "build_snapshot" : false, "lucene_version" : "5.5.4" }, "tagline" : "You Know, for Search" } ```
java连接elasticsearch抛异常None of the configured nodes are available
阿里云上docker方式部署了单节点的6.5.3版本的es,elasticsearch.yml配置如下: ``` cluster.name: "docker-cluster" node.name: node-test network.bind_host: 0.0.0.0 network.publish_host: 58.87.73.232 discovery.zen.ping.unicast.hosts: ["58.87.73.232:9300"] discovery.zen.minimum_master_nodes: 1 http.cors.enabled: true http.cors.allow-origin: "*" ``` 通过springboot2.1.1项目集成spring-boot-starter-data-elasticsearch application.properties配置如下: ``` spring.data.elasticsearch.cluster-name=docker-cluster spring.data.elasticsearch.cluster-nodes=58.87.73.232:9300 ``` 启动项目的测试用例抛异常**NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{rLnGNbz3QFaEToPtiuFTgQ}{58.87.73.232}{58.87.73.232:9300}]] ** 请问什么原因? 附节点状态截图: ![图片说明](https://img-ask.csdn.net/upload/201909/10/1568100643_439007.png)
卡夫卡kafka消费问题,消费一段时间就会超时 求助原因
``` 80 DEBUG [YyjkStorageKafkaConsumerThread] YyjkStorageKafkaConsumerThread.value:{"tableName":"sw_segment","operateType":"INSERT","operateId":"4921.43.15759673490360004","indexType":"type","storageType":"elasticsearch","date":1575967330707,"tableData":{"trace_id":"4921.43.15759673490360005","endpoint_name":"/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat","latency":3,"end_time":1575967349039,"endpoint_id":189076,"service_instance_id":4921,"version":2,"start_time":1575967349036,"data_binary":"Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm","service_id":13,"time_bucket":20191210164229,"is_error":0,"segment_id":"4921.43.15759673490360004"}} 16:40:05,480 DEBUG [YyjkStorageKafkaConsumerThread] YyjkStorageKafkaConsumerThread.FormatData,tableName:sw_segment|operateId:4921.43.15759673490360004|tableMap:{trace_id=4921.43.15759673490360005, endpoint_name=/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat, latency=3, end_time=1575967349039, endpoint_id=189076, service_instance_id=4921, version=2, start_time=1575967349036, data_binary=Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm, service_id=13, time_bucket=20191210164229, is_error=0, segment_id=4921.43.15759673490360004} 16:40:05,480 DEBUG [ElasticSearchClient] Executing bulk [32] with 8 requests 16:40:05,481 DEBUG [MainClientExec] [exchange: 44] start execution 16:40:05,481 DEBUG [RequestAddCookies] CookieSpec selected: default 16:40:05,481 DEBUG [RequestAuthCache] Re-using cached 'basic' auth scheme for http://10.23.11.224:9200 16:40:05,481 DEBUG [RequestAuthCache] No credentials for preemptive authentication 16:40:05,481 DEBUG [InternalHttpAsyncClient] [exchange: 44] Request connection for {}->http://10.23.11.224:9200 16:40:05,481 DEBUG [PoolingNHttpClientConnectionManager] Connection request: [route: {}->http://10.23.11.224:9200][total kept alive: 1; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set timeout 0 16:40:05,482 DEBUG [PoolingNHttpClientConnectionManager] Connection leased: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 0; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:05,482 DEBUG [InternalHttpAsyncClient] [exchange: 44] Connection allocated: CPoolProxy{http-outgoing-0 [ACTIVE]} 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set attribute http.nio.exchange-handler 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:r]: Event set [w] 16:40:05,482 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Request ready 16:40:05,482 DEBUG [InternalHttpAsyncClient] Connection route already established 16:40:05,482 DEBUG [MainClientExec] [exchange: 44] Attempt 1 to execute request 16:40:05,482 DEBUG [MainClientExec] Target auth state: UNCHALLENGED 16:40:05,482 DEBUG [MainClientExec] Proxy auth state: UNCHALLENGED 16:40:05,482 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: Set timeout 30000 16:40:05,482 DEBUG [headers] http-outgoing-0 >> POST /_bulk?timeout=1m HTTP/1.1 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Content-Length: 6657 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Content-Type: application/json 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Host: 10.23.11.224:9200 16:40:05,482 DEBUG [headers] http-outgoing-0 >> Connection: Keep-Alive 16:40:05,482 DEBUG [headers] http-outgoing-0 >> User-Agent: Apache-HttpAsyncClient/4.1.2 (Java/1.8.0_221) 16:40:05,483 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: Event set [w] 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Output ready 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] produce content 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 6657; pos: 4096; completed: false] 16:40:05,483 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: 4293 bytes written 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "POST /_bulk?timeout=1m HTTP/1.1[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Content-Length: 6657[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Content-Type: application/json[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Host: 10.23.11.224:9200[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "User-Agent: Apache-HttpAsyncClient/4.1.2 (Java/1.8.0_221)[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "[\r][\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.88.15759673496781142"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.88.15759673496781143","endpoint_name":"/authentication","latency":71,"end_time":1575967349749,"endpoint_id":150,"service_instance_id":11,"version":2,"start_time":1575967349678,"data_binary":"CgwKCgtY1oK15O6q/xsS3gEIARivt+X37i0gurfl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6kwEKDGRiLnN0YXRlbWVudBKCAXNlbGVjdCB0LmNoZWNrX3RpbWUsdC5leHRlbmRfaW5mbyx0LnVzZXJfbmFtZSx0LmxvZ2luX2NoYW5uZWwgZnJvbSBzc29fdXNlcl9zZXNzaW9uIHQgd2hlcmUgdC50aWNrZXQgPSA/IGFuZCB0LmxvZ291dF90aW1lIGlzIG51bGwSnAEIAhjGt+X37i0g2Lfl9+4tMJUBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6UgoMZGIuc3RhdGVtZW50EkJ1cGRhdGUgc3NvX3VzZXJfc2Vzc2lvbiB0IHNldCB0LmV4dGVuZF9pbmZvID0gPyB3aGVyZSB0LnRpY2tldCA9ID8SWAgDGNm35ffuLSDrt+X37i0wlAFABVABWAFgIXoOCgdkYi50eXBlEgNzcWx6GwoLZGIuaW5zdGFuY2USDHR5Z3pwdF9kenN3anoOCgxkYi5zdGF0ZW1lbnQSZhD///////////8BGK635ffuLSD1t+X37i0wlgFYA2ABejAKA3VybBIpaHR0cDovL25zc28uZHpzd2pqYy50YXguY24vYXV0aGVudGljYXRpb256EgoLaHR0cC5tZXRob2QSA0dFVBgMIAs=","service_id":12,"time_bucket":20191210164229,"is_error":0,"segment_id":"11.88.15759673496781142"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673457660020"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.36.15759673457660021","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":377,"end_time":1575967346143,"endpoint_id":162,"service_instance_id":4921,"version":2,"start_time":1575967345766,"data_binary":"Cg0KC7kmJPSg4dHuqv8bErYBEP///////////wEY5pjl9+4tIN+b5ffuLTCiAUADUAFYAWAheg4KB2RiLnR5cGUSA3NxbHohCgtkYi5pbnN0YW5jZRISdHlnenB0X2R6c3dqX3d3X2tmel0KDGRiLnN0YXRlbWVudBJNc2VsZWN0ICogZnJvbSBxel9kbWIgd2hlcmUgeHlieiA9ICdZJyBBTkQgeXhieiA9ICdZJyBhbmQgbG93ZXIoY29kZSk9bG93ZXIoPykYDSC5Jg==","service_id":13,"time_bucket":20191210164225,"is_error":0,"segment_id":"4921.36.15759673457660020"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673461450022"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.36.15759673461450023","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":69,"end_time":1575967346214,"endpoint_id":162,"service_instance_id":4921,"version":2,"start_time":1575967346145,"data_binary":"Cg0KC7kmJKbKyNPuqv8bErYBEP///////////wEY4Zvl9+4tIKac5ffuLTCiAUADUAFYAWAheg4KB2RiLnR5cGUSA3NxbHohCgtkYi5pbnN0YW5jZRISdHlnenB0X2R6c3dqX3d3X2tmel0KDGRiLnN0YXRlbWVudBJNc2VsZWN0ICogZnJvbSBxel9kbWIgd2hlcmUgeHlieiA9ICdZJyBBTkQgeXhieiA9ICdZJyBhbmQgbG93ZXIoY29kZSk9bG93ZXIoPykYDSC5Jg==","service_id":13,"time_bucket":20191210164226,"is_error":0,"segment_id":"4921.36.15759673461450022"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673529984298"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.37.15759673529984299","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":14,"end_time":1575967353012,"endpoint_id":137,"service_instance_id":11,"version":2,"start_time":1575967352998,"data_binary":"CgwKCgslqsqf9O6q/xsSsAEQ////////////ARim0eX37i0gtNHl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6XQoMZGIuc3RhdGVtZW50Ek1zZWxlY3QgKiBmcm9tIHF6X2RtYiB3aGVyZSB4eWJ6ID0gJ1knIEFORCB5eGJ6ID0gJ1knIGFuZCBsb3dlcihjb2RlKT1sb3dlcig/KRgMIAs=","service_id":12,"time_bucket":20191210164232,"is_error":0,"segment_id":"11.37.15759673529984298"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673530124300"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.37.15759673530124301","endpoint_name":"Mysql/JDBI/PreparedStatement/executeQuery","latency":12,"end_time":1575967353024,"endpoint_id":137,"service_instance_id":11,"version":2,"start_time":1575967353012,"data_binary":"CgwKCgsljJCo9O6q/xsSsAEQ////////////ARi00eX37i0gwNHl9+4tMIkBQAVQAVgBYCF6DgoHZGIudHlwZRIDc3FsehsKC2RiLmluc3RhbmNlEgx0eWd6cHRfZHpzd2p6XQoMZGIuc3RhdGVtZW50Ek1zZWxlY3QgKiBmcm9tIHF6X2RtYiB3aGVyZSB4eWJ6ID0gJ1knIEFORCB5eGJ6ID0gJ1knIGFuZCBsb3dlcihjb2RlKT1sb3dlcig/KRgMIAs=","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.37.15759673530124300"}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539631576"}}[\n]" 16:40:05,483 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.47.15759673539631577","endpoint_name":"/v4/default/registry/mi" 16:40:05,483 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Output ready 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] produce content 16:40:05,483 DEBUG [MainClientExec] [exchange: 44] Request completed 16:40:05,484 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 6657; pos: 6657; completed: true] 16:40:05,484 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][rw:w]: 2561 bytes written 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "croservices/62af8840312c4750370c3ea64fd68203bf02d518/instances/1563e3d11a5f11eabd58005056b67cc4/heartbeat","latency":2,"end_time":1575967353965,"endpoint_id":146,"service_instance_id":11,"version":2,"start_time":1575967353963,"data_binary":"CgwKCgsv2LPs+O6q/xsSwwEQ////////////ARjr2OX37i0g7djl9+4tMJIBQAdQAVgDYDt6EgoLaHR0cC5tZXRob2QSA1BVVHqIAQoDdXJsEoABL3Y0L2RlZmF1bHQvcmVnaXN0cnkvbWljcm9zZXJ2aWNlcy82MmFmODg0MDMxMmM0NzUwMzcwYzNlYTY0ZmQ2ODIwM2JmMDJkNTE4L2luc3RhbmNlcy8xNTYzZTNkMTFhNWYxMWVhYmQ1ODAwNTA1NmI2N2NjNC9oZWFydGJlYXQYDCAL","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.47.15759673539631576"}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539651578"}}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"11.47.15759673539631577","endpoint_name":"#/v4/default/registry/microservices/62af8840312c4750370c3ea64fd68203bf02d518/instances/1563e3d11a5f11eabd58005056b67cc4/heartbeat","latency":0,"end_time":1575967353965,"endpoint_id":147,"service_instance_id":11,"version":2,"start_time":1575967353965,"data_binary":"CgwKCgsv+s/t+O6q/xsSwAMQ////////////ARjt2OX37i0g7djl9+4tKpoCCAESDAoKCy/Ys+z47qr/GyALOAtCgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzLzYyYWY4ODQwMzEyYzQ3NTAzNzBjM2VhNjRmZDY4MjAzYmYwMmQ1MTgvaW5zdGFuY2VzLzE1NjNlM2QxMWE1ZjExZWFiZDU4MDA1MDU2YjY3Y2M0L2hlYXJ0YmVhdFKAAS92NC9kZWZhdWx0L3JlZ2lzdHJ5L21pY3Jvc2VydmljZXMvNjJhZjg4NDAzMTJjNDc1MDM3MGMzZWE2NGZkNjgyMDNiZjAyZDUxOC9pbnN0YW5jZXMvMTU2M2UzZDExYTVmMTFlYWJkNTgwMDUwNTZiNjdjYzQvaGVhcnRiZWF0OoEBIy92NC9kZWZhdWx0L3JlZ2lzdHJ5L21pY3Jvc2VydmljZXMvNjJhZjg4NDAzMTJjNDc1MDM3MGMzZWE2NGZkNjgyMDNiZjAyZDUxOC9pbnN0YW5jZXMvMTU2M2UzZDExYTVmMTFlYWJkNTgwMDUwNTZiNjdjYzQvaGVhcnRiZWF0UAJYA2A7GAwgCw==","service_id":12,"time_bucket":20191210164233,"is_error":0,"segment_id":"11.47.15759673539651578"}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"index":{"_index":"sw_segment","_type":"type","_id":"4921.43.15759673490360004"}}[\n]" 16:40:05,484 DEBUG [wire] http-outgoing-0 >> "{"trace_id":"4921.43.15759673490360005","endpoint_name":"/v4/default/registry/microservices/b0b6cb4d62e32b56c3bf8cb4bd2b7aed46cdffbe/instances/72abd3701b1811eaa6ea005056b6530b/heartbeat","latency":3,"end_time":1575967349039,"endpoint_id":189076,"service_instance_id":4921,"version":2,"start_time":1575967349036,"data_binary":"Cg0KC7kmK8SNreHuqv8bEsQBEP///////////wEYrLLl9+4tIK+y5ffuLTCUxQtABFABWANgO3oSCgtodHRwLm1ldGhvZBIDUFVUeogBCgN1cmwSgAEvdjQvZGVmYXVsdC9yZWdpc3RyeS9taWNyb3NlcnZpY2VzL2IwYjZjYjRkNjJlMzJiNTZjM2JmOGNiNGJkMmI3YWVkNDZjZGZmYmUvaW5zdGFuY2VzLzcyYWJkMzcwMWIxODExZWFhNmVhMDA1MDU2YjY1MzBiL2hlYXJ0YmVhdBgNILkm","service_id":13,"time_bucket":20191210164229,"is_error":0,"segment_id":"4921.43.15759673490360004"}[\n]" 16:40:05,484 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] Request ready 16:40:05,484 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:w]: Event cleared [w] 16:40:06,073 DEBUG [FetchSessionHandler] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Node 0 sent an incremental fetch response for session 520315326 with 0 response partition(s), 1 implied partition(s) 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: 1460 bytes read 16:40:07,365 DEBUG [wire] http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "content-type: application/json; charset=UTF-8[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "content-length: 3697[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "[\r][\n]" 16:40:07,365 DEBUG [wire] http-outgoing-0 << "{"took":1872,"errors":true,"items":[{"index":{"_index":"sw_segment","_type":"type","_id":"11.88.15759673496781142","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673457660020","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.36.15759673461450022","_version":1,"result":"created","_shards"" 16:40:07,365 DEBUG [headers] http-outgoing-0 << HTTP/1.1 200 OK 16:40:07,365 DEBUG [headers] http-outgoing-0 << content-type: application/json; charset=UTF-8 16:40:07,365 DEBUG [headers] http-outgoing-0 << content-length: 3697 16:40:07,365 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE(1372)] Response received 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Response received HTTP/1.1 200 OK 16:40:07,365 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE(1372)] Input ready 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Consume content 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: 2325 bytes read 16:40:07,365 DEBUG [wire] http-outgoing-0 << ":{"total":1,"successful":1,"failed":0},"_seq_no":24332,"_primary_term":1,"status":201}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673529984298","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.37.15759673530124300","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":24333,"_primary_term":1,"status":201}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539631576","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"11.47.15759673539651578","status":429,"error":{"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [32196501][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[sw_segment][1]] containing [5] requests, target allocation id: U61PmKwGRPe_wjkdosiWUg, primary term: 1 on EsThreadPoolExecutor[name = JKPT-ES-NODE-001/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@37fc16a1[Running, pool size = 8, active threads = 8, queued tasks = 200, completed tasks = 4765825]]"}}},{"index":{"_index":"sw_segment","_type":"type","_id":"4921.43.15759673490360004","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":24334,"_primary_term":1,"status":201}}]}" 16:40:07,365 DEBUG [InternalHttpAsyncClient] [exchange: 44] Connection can be kept alive indefinitely 16:40:07,365 DEBUG [MainClientExec] [exchange: 44] Response processed 16:40:07,365 DEBUG [InternalHttpAsyncClient] [exchange: 44] releasing connection 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Remove attribute http.nio.exchange-handler 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Releasing connection: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 0; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Connection [id: http-outgoing-0][route: {}->http://10.23.11.224:9200] can be kept alive indefinitely 16:40:07,365 DEBUG [ManagedNHttpClientConnectionImpl] http-outgoing-0 10.23.6.33:6663<->10.23.11.224:9200[ACTIVE][r:r]: Set timeout 0 16:40:07,365 DEBUG [PoolingNHttpClientConnectionManager] Connection released: [id: http-outgoing-0][route: {}->http://10.23.11.224:9200][total kept alive: 1; route allocated: 1 of 10; total allocated: 1 of 30] 16:40:07,367 DEBUG [RestClient] request [POST http://10.23.11.224:9200/_bulk?timeout=1m] returned [HTTP/1.1 200 OK] 16:40:07,367 DEBUG [InternalIODispatch] http-outgoing-0 [ACTIVE] [content length: 3697; pos: 3697; completed: true] 16:40:08,187 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:40:08,389 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:40:11,203 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:40:11,404 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:40:14,221 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:20,774 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:41:23,589 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:23,790 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response actCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 16:41:38,665 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 16:41:38,867 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:13:13,402 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:13:13,605 DEBUG [NetworkClient] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Node -1 disconnected. 17:13:13,606 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:13:13,707 DEBUG [NetworkClient] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending metadata request (type=MetadataRequest, topics=compute_traceStorage, allowAutoCreate=true) to node 10.23.11.235:9092 (id: 0 rack: null) 17:13:13,907 DEBUG [Metadata] Updating last seen epoch from 0 to 0 for partition compute_traceStorage-0 17:13:13,907 DEBUG [Metadata] Updated cluster metadata version 4 to MetadataCache{cluster=Cluster(id = yQ_sRlMlSui8hlVtaPl4wg, nodes = [10.23.11.235:9092 (id: 0 rack: null)], partitions = [Partition(topic = compute_traceStorage, partition = 0, leader = 0, replicas = [0], isr = [0], offlineReplicas = [])], controller = 10.23.11.235:9092 (id: 0 rack: null))} 17:13:16,420 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Sending Heartbeat request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:13:16, 17:15:02,170 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Received successful Heartbeat response 17:15:04,683 WARN [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] This member will leave the group because consumer poll timeout has expired. This means the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time processing messages. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records. 17:15:04,683 INFO [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Member consumer-1-f8b4d0da-f83c-4849-8cfd-74e748aad3c7 sending LeaveGroup request to coordinator 10.23.11.235:9092 (id: 2147483647 rack: null) 17:15:04,683 DEBUG [AbstractCoordinator] [Consumer clientId=consumer-1, groupId=jkpt-transfer-group] Disabling heartbeat thread ```
外部浏览器连接linux中elasticsearch的集群状态问题?
在linux终端中显示$ curl '192.168.80.128:9200' { "name" : "node-1", "cluster_name" : "my-elasticsearch", "cluster_uuid" : "HK--vs3_S8-4tRq0mMhdpw", "version" : { "number" : "2.4.1", "build_hash" : "c67dc32e24162035d18d6fe1e952c4cbcbe79d16", "build_timestamp" : "2016-09-27T18:57:55Z", "build_snapshot" : false, "lucene_version" : "5.5.2" }, "tagline" : "You Know, for Search" } 如何在外部浏览器(windows)中获取其中的状态 http://192.168.80.128:9200/ 显示无法链接 防火墙已经关闭
sonar首次启动报错,百思不得。
--> Wrapper Started as Daemon Launching a JVM... Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. 2015.12.15 17:22:49 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /usr/local/jdk1.8/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/usr/local/sonar/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /tmp/sq-process293857443061072123properties 2015.12.15 17:22:49 INFO es[o.s.p.ProcessEntryPoint] Starting search 2015.12.15 17:22:49 INFO es[o.s.s.SearchSettings] Elasticsearch listening on 127.0.0.1:9001 2015.12.15 17:22:49 INFO es[o.elasticsearch.node] [sonar-1450171368610] version[1.7.2], pid[2571], build[e43676b/2015-09-14T09:49:53Z] 2015.12.15 17:22:49 INFO es[o.elasticsearch.node] [sonar-1450171368610] initializing ... 2015.12.15 17:22:49 INFO es[o.e.plugins] [sonar-1450171368610] loaded [], sites [] 2015.12.15 17:22:50 INFO es[o.elasticsearch.env] [sonar-1450171368610] using [1] data paths, mounts [[/ (/dev/sda3)]], net usable_space [111.1gb], net total_space [125.6gb], types [ext4] 2015.12.15 17:22:51 WARN es[o.e.bootstrap] JNA not found. native methods will be disabled. 2015.12.15 17:22:52 INFO es[o.elasticsearch.node] [sonar-1450171368610] initialized 2015.12.15 17:22:52 INFO es[o.elasticsearch.node] [sonar-1450171368610] starting ... 2015.12.15 17:22:52 INFO es[o.e.transport] [sonar-1450171368610] bound_address {inet[/127.0.0.1:9001]}, publish_address {inet[/127.0.0.1:9001]} 2015.12.15 17:22:52 INFO es[o.e.discovery] [sonar-1450171368610] sonarqube/OLzNZ47NQRa0wZYzKc659Q 2015.12.15 17:22:56 INFO es[o.e.cluster.service] [sonar-1450171368610] new_master [sonar-1450171368610][OLzNZ47NQRa0wZYzKc659Q][localhost][inet[/127.0.0.1:9001]]{rack_id=sonar-1450171368610}, reason: zen-disco-join (elected_as_master) 2015.12.15 17:22:56 INFO es[o.elasticsearch.node] [sonar-1450171368610] started 2015.12.15 17:22:56 INFO es[o.e.gateway] [sonar-1450171368610] recovered [1] indices into cluster_state Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=160m; support was removed in 8.0 2015.12.15 17:22:58 INFO app[o.s.p.m.Monitor] Process[search] is up 2015.12.15 17:22:58 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/local/jdk1.8/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx768m -Xms256m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/usr/local/sonar/temp -cp ./lib/common/*:./lib/server/*:/usr/local/sonar/lib/jdbc/mysql/mysql-connector-java-5.1.35.jar org.sonar.server.app.WebServer /tmp/sq-process3225582527192006271properties 2015.12.15 17:22:59 INFO web[o.s.p.ProcessEntryPoint] Starting web 2015.12.15 17:22:59 INFO web[o.s.s.app.Webapp] Webapp directory: /usr/local/sonar/web 2015.12.15 17:23:00 INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-0.0.0.0-9000"] 2015.12.15 17:23:00 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read 2015.12.15 17:23:01 INFO web[o.e.plugins] [sonar-1450171368610] loaded [], sites [] 2015.12.15 17:23:02 INFO web[o.s.s.p.ServerImpl] SonarQube Server / 5.2 / f045be98be3ba032b6b19d71574038eeeb91803b 2015.12.15 17:23:02 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:mysql://192.168.22.220:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance 2015.12.15 17:23:03 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener org.sonar.api.utils.MessageException: Current version is too old. Please upgrade to Long Term Support version firstly. 2015.12.15 17:23:03 INFO web[jruby.rack] jruby 1.7.9 (ruby-1.8.7p370) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_45-b14 [linux-amd64] **2015.12.15 17:23:03 INFO web[jruby.rack] using a shared (threadsafe!) runtime 2015.12.15 17:23:08 ERROR web[jruby.rack] initialization failed org.jruby.rack.RackInitializationException: java.lang.NullPointerException**** at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:31) ~[jruby-rack-1.1.13.2.jar:na] at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:98) ~[jruby-rack-1.1.13.2.jar:na] at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50) ~[jruby-rack-1.1.13.2.jar:na] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720) [tomcat-embed-core-8.0.18.jar:8.0.18] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) [tomcat-embed-core-8.0.18.jar:8.0.18]
接口jar包在云服务器正常运行,直接复制下来部署到一个新的云服务器上去出错
# 环境描述:CentOS7,部署Java1.8,跟tomcat环境,将就服务器上面还在正常运行的jar包直接复制下来,部署到新的服务器 异常(我是新手也不知道那段有用之能都贴上来了,麻烦各位大佬了,实在不好意思): [root@VM_0_14_centos target]# tail -f nohup.out 2019-06-22 13:30:55.081 DEBUG 21363 --- [ main] ConfigServletWebServerApplicationContext : Bean factory for org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5479e3f: org.springframework.beans.factory.support.DefaultListableBeanFactory@3aa9e816: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,hyperthermiaApplication]; root of factory hierarchy 2019-06-22 13:30:59.856 DEBUG 21363 --- [ main] ConfigServletWebServerApplicationContext : Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@475e586c] 2019-06-22 13:30:59.857 DEBUG 21363 --- [ main] ConfigServletWebServerApplicationContext : Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@657c8ad9] 2019-06-22 13:31:01.329 DEBUG 21363 --- [ main] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: /home/target/hyperthermia-0.0.1-SNAPSHOT.jar 2019-06-22 13:31:01.329 DEBUG 21363 --- [ main] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: /home/target/hyperthermia-0.0.1-SNAPSHOT.jar 2019-06-22 13:31:01.329 DEBUG 21363 --- [ main] .s.b.w.e.t.TomcatServletWebServerFactory : None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored. 2019-06-22 13:31:01.494 INFO 21363 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8800 (http) 2019-06-22 13:31:01.594 INFO 21363 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-06-22 13:31:01.594 INFO 21363 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.32 2019-06-22 13:31:01.670 INFO 21363 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib] 2019-06-22 13:31:02.008 INFO 21363 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-06-22 13:31:02.008 INFO 21363 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 6950 ms 2019-06-22 13:31:02.049 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Added existing Servlet initializer bean 'dispatcherServletRegistration'; order=2147483647, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration.class] 2019-06-22 13:31:02.240 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'characterEncodingFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.class] 2019-06-22 13:31:02.240 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'hiddenHttpMethodFilter'; order=-10000, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class] 2019-06-22 13:31:02.241 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'httpPutFormContentFilter'; order=-9900, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class] 2019-06-22 13:31:02.241 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'requestContextFilter'; order=-105, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class] 2019-06-22 13:31:02.276 INFO 21363 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/] 2019-06-22 13:31:02.283 INFO 21363 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 2019-06-22 13:31:02.284 INFO 21363 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2019-06-22 13:31:02.284 INFO 21363 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2019-06-22 13:31:02.284 INFO 21363 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2019-06-22 13:31:02.382 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.f.OrderedRequestContextFilter : Initializing filter 'requestContextFilter' 2019-06-22 13:31:02.385 DEBUG 21363 --- [ost-startStop-1] o.s.b.w.s.f.OrderedRequestContextFilter : Filter 'requestContextFilter' configured successfully 2019-06-22 13:31:02.386 DEBUG 21363 --- [ost-startStop-1] .b.w.s.f.OrderedHttpPutFormContentFilter : Initializing filter 'httpPutFormContentFilter' 2019-06-22 13:31:02.386 DEBUG 21363 --- [ost-startStop-1] .b.w.s.f.OrderedHttpPutFormContentFilter : Filter 'httpPutFormContentFilter' configured successfully 2019-06-22 13:31:02.386 DEBUG 21363 --- [ost-startStop-1] .s.b.w.s.f.OrderedHiddenHttpMethodFilter : Initializing filter 'hiddenHttpMethodFilter' 2019-06-22 13:31:02.386 DEBUG 21363 --- [ost-startStop-1] .s.b.w.s.f.OrderedHiddenHttpMethodFilter : Filter 'hiddenHttpMethodFilter' configured successfully 2019-06-22 13:31:02.387 DEBUG 21363 --- [ost-startStop-1] s.b.w.s.f.OrderedCharacterEncodingFilter : Initializing filter 'characterEncodingFilter' 2019-06-22 13:31:02.387 DEBUG 21363 --- [ost-startStop-1] s.b.w.s.f.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured successfully 2019-06-22 13:31:03.902 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/kill],methods=[POST]}" onto public java.lang.String com.galaxy.controller.TestController.kill(java.lang.String) throws java.lang.Exception 2019-06-22 13:31:03.904 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/restart],methods=[POST]}" onto public java.lang.String com.galaxy.controller.TestController.restart(java.lang.String) 2019-06-22 13:31:03.905 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/powerdown],methods=[POST]}" onto public java.lang.String com.galaxy.controller.TestController.powerdown(java.lang.String) 2019-06-22 13:31:03.906 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/query],methods=[POST]}" onto public java.util.HashMap<java.lang.String, java.lang.String> com.galaxy.controller.TestController.queryConfig(java.lang.String,java.lang.Integer) throws java.lang.Exception 2019-06-22 13:31:03.907 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/send],methods=[POST]}" onto public java.lang.String com.galaxy.controller.TestController.send(java.lang.String,java.lang.String,java.lang.String) 2019-06-22 13:31:03.908 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/list],methods=[POST]}" onto public java.util.ArrayList<java.lang.String> com.galaxy.controller.TestController.list() 2019-06-22 13:31:03.933 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/ui]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration() 2019-06-22 13:31:03.935 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/security]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration() 2019-06-22 13:31:03.936 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources]}" onto public org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources() 2019-06-22 13:31:03.963 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2019-06-22 13:31:03.964 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-06-22 13:31:04.453 INFO 21363 --- [ main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)] 2019-06-22 13:31:04.804 INFO 21363 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-06-22 13:31:05.368 INFO 21363 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5479e3f: startup date [Sat Jun 22 13:30:55 CST 2019]; root of context hierarchy 2019-06-22 13:31:05.579 INFO 21363 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-06-22 13:31:05.579 INFO 21363 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-06-22 13:31:06.133 INFO 21363 --- [ main] org.quartz.impl.StdSchedulerFactory : Using default implementation for ThreadExecutor 2019-06-22 13:31:06.289 INFO 21363 --- [ main] org.quartz.core.SchedulerSignalerImpl : Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 2019-06-22 13:31:06.290 INFO 21363 --- [ main] org.quartz.core.QuartzScheduler : Quartz Scheduler v.2.3.0 created. 2019-06-22 13:31:06.291 INFO 21363 --- [ main] org.quartz.simpl.RAMJobStore : RAMJobStore initialized. 2019-06-22 13:31:06.292 INFO 21363 --- [ main] org.quartz.core.QuartzScheduler : Scheduler meta-data: Quartz Scheduler (v2.3.0) 'quartzScheduler' with instanceId 'NON_CLUSTERED' ``` Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads. Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered. ``` 2019-06-22 13:31:06.292 INFO 21363 --- [ main] org.quartz.impl.StdSchedulerFactory : Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance. 2019-06-22 13:31:06.292 INFO 21363 --- [ main] org.quartz.impl.StdSchedulerFactory : Quartz scheduler version: 2.3.0 2019-06-22 13:31:06.292 INFO 21363 --- [ main] org.quartz.core.QuartzScheduler : JobFactory set to: org.springframework.boot.autoconfigure.quartz.AutowireCapableBeanJobFactory@3f6b0be5 2019-06-22 13:31:06.488 INFO 21363 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup 2019-06-22 13:31:06.514 DEBUG 21363 --- [ main] ConfigServletWebServerApplicationContext : Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@1de76cc7] 2019-06-22 13:31:06.519 INFO 21363 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647 2019-06-22 13:31:06.519 INFO 21363 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed 2019-06-22 13:31:06.586 INFO 21363 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s) 2019-06-22 13:31:06.677 INFO 21363 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references 2019-06-22 13:31:07.131 INFO 21363 --- [ main] o.s.s.quartz.SchedulerFactoryBean : Starting Quartz Scheduler now 2019-06-22 13:31:07.131 INFO 21363 --- [ main] org.quartz.core.QuartzScheduler : Scheduler quartzScheduler_$_NON_CLUSTERED started. 2019-06-22 13:31:07.186 DEBUG 21363 --- [ main] ConditionEvaluationReportLoggingListener : ============================ CONDITIONS EVALUATION REPORT ============================ Positive matches: ----------------- CodecsAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.http.codec.CodecConfigurer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) CodecsAutoConfiguration.JacksonCodecConfiguration matched: - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) CodecsAutoConfiguration.JacksonCodecConfiguration#jacksonCodecCustomizer matched: - @ConditionalOnBean (types: com.fasterxml.jackson.databind.ObjectMapper; SearchStrategy: all) found bean 'jacksonObjectMapper' (OnBeanCondition) DispatcherServletAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.web.servlet.DispatcherServlet'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) DispatcherServletAutoConfiguration.DispatcherServletConfiguration matched: - @ConditionalOnClass found required class 'javax.servlet.ServletRegistration'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - Default DispatcherServlet did not find dispatcher servlet beans (DispatcherServletAutoConfiguration.DefaultDispatcherServletCondition) DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration matched: - @ConditionalOnClass found required class 'javax.servlet.ServletRegistration'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - DispatcherServlet Registration did not find servlet registration bean (DispatcherServletAutoConfiguration.DispatcherServletRegistrationCondition) DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration#dispatcherServletRegistration matched: - @ConditionalOnBean (names: dispatcherServlet; types: org.springframework.web.servlet.DispatcherServlet; SearchStrategy: all) found bean 'dispatcherServlet' (OnBeanCondition) EmbeddedWebServerFactoryCustomizerAutoConfiguration.TomcatWebServerFactoryCustomizerConfiguration matched: - @ConditionalOnClass found required classes 'org.apache.catalina.startup.Tomcat', 'org.apache.coyote.UpgradeProtocol'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) ErrorMvcAutoConfiguration matched: - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.springframework.web.servlet.DispatcherServlet'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) ErrorMvcAutoConfiguration#basicErrorController matched: - @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.error.ErrorController; SearchStrategy: current) did not find any beans (OnBeanCondition) ErrorMvcAutoConfiguration#errorAttributes matched: - @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.error.ErrorAttributes; SearchStrategy: current) did not find any beans (OnBeanCondition) ErrorMvcAutoConfiguration.DefaultErrorViewResolverConfiguration#conventionErrorViewResolver matched: - @ConditionalOnBean (types: org.springframework.web.servlet.DispatcherServlet; SearchStrategy: all) found bean 'dispatcherServlet'; @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.web.servlet.error.DefaultErrorViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition) ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration matched: - @ConditionalOnProperty (server.error.whitelabel.enabled) matched (OnPropertyCondition) - ErrorTemplate Missing did not find error template view (ErrorMvcAutoConfiguration.ErrorTemplateMissingCondition) ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration#beanNameViewResolver matched: - @ConditionalOnMissingBean (types: org.springframework.web.servlet.view.BeanNameViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition) ErrorMvcAutoConfiguration.WhitelabelErrorViewConfiguration#defaultErrorView matched: - @ConditionalOnMissingBean (names: error; SearchStrategy: all) did not find any beans (OnBeanCondition) GenericCacheConfiguration matched: - Cache org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration automatic cache type (CacheCondition) HttpEncodingAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.web.filter.CharacterEncodingFilter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) - @ConditionalOnProperty (spring.http.encoding.enabled) matched (OnPropertyCondition) HttpEncodingAutoConfiguration#characterEncodingFilter matched: - @ConditionalOnMissingBean (types: org.springframework.web.filter.CharacterEncodingFilter; SearchStrategy: all) did not find any beans (OnBeanCondition) HttpMessageConvertersAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.http.converter.HttpMessageConverter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) HttpMessageConvertersAutoConfiguration#messageConverters matched: - @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.http.HttpMessageConverters; SearchStrategy: all) did not find any beans (OnBeanCondition) HttpMessageConvertersAutoConfiguration.StringHttpMessageConverterConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.http.converter.StringHttpMessageConverter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) HttpMessageConvertersAutoConfiguration.StringHttpMessageConverterConfiguration#stringHttpMessageConverter matched: - @ConditionalOnMissingBean (types: org.springframework.http.converter.StringHttpMessageConverter; SearchStrategy: all) did not find any beans (OnBeanCondition) JacksonAutoConfiguration matched: - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) JacksonAutoConfiguration.Jackson2ObjectMapperBuilderCustomizerConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) JacksonAutoConfiguration.JacksonObjectMapperBuilderConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) JacksonAutoConfiguration.JacksonObjectMapperBuilderConfiguration#jacksonObjectMapperBuilder matched: - @ConditionalOnMissingBean (types: org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition) JacksonAutoConfiguration.JacksonObjectMapperConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) JacksonAutoConfiguration.JacksonObjectMapperConfiguration#jacksonObjectMapper matched: - @ConditionalOnMissingBean (types: com.fasterxml.jackson.databind.ObjectMapper; SearchStrategy: all) did not find any beans (OnBeanCondition) JacksonAutoConfiguration.ParameterNamesModuleConfiguration matched: - @ConditionalOnClass found required class 'com.fasterxml.jackson.module.paramnames.ParameterNamesModule'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) JacksonAutoConfiguration.ParameterNamesModuleConfiguration#parameterNamesModule matched: - @ConditionalOnMissingBean (types: com.fasterxml.jackson.module.paramnames.ParameterNamesModule; SearchStrategy: all) did not find any beans (OnBeanCondition) JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration matched: - @ConditionalOnClass found required class 'com.fasterxml.jackson.databind.ObjectMapper'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - @ConditionalOnProperty (spring.http.converters.preferred-json-mapper=jackson) matched (OnPropertyCondition) - @ConditionalOnBean (types: com.fasterxml.jackson.databind.ObjectMapper; SearchStrategy: all) found bean 'jacksonObjectMapper' (OnBeanCondition) JacksonHttpMessageConvertersConfiguration.MappingJackson2HttpMessageConverterConfiguration#mappingJackson2HttpMessageConverter matched: - @ConditionalOnMissingBean (types: org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; SearchStrategy: all) did not find any beans (OnBeanCondition) JmxAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.jmx.export.MBeanExporter'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - @ConditionalOnProperty (spring.jmx.enabled=true) matched (OnPropertyCondition) JmxAutoConfiguration#mbeanExporter matched: - @ConditionalOnMissingBean (types: org.springframework.jmx.export.MBeanExporter; SearchStrategy: current) did not find any beans (OnBeanCondition) JmxAutoConfiguration#mbeanServer matched: - @ConditionalOnMissingBean (types: javax.management.MBeanServer; SearchStrategy: all) did not find any beans (OnBeanCondition) JmxAutoConfiguration#objectNamingStrategy matched: - @ConditionalOnMissingBean (types: org.springframework.jmx.export.naming.ObjectNamingStrategy; SearchStrategy: current) did not find any beans (OnBeanCondition) MultipartAutoConfiguration matched: - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.springframework.web.multipart.support.StandardServletMultipartResolver', 'javax.servlet.MultipartConfigElement'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) - @ConditionalOnProperty (spring.servlet.multipart.enabled) matched (OnPropertyCondition) MultipartAutoConfiguration#multipartConfigElement matched: - @ConditionalOnMissingBean (types: javax.servlet.MultipartConfigElement,org.springframework.web.multipart.commons.CommonsMultipartResolver; SearchStrategy: all) did not find any beans (OnBeanCondition) MultipartAutoConfiguration#multipartResolver matched: - @ConditionalOnMissingBean (types: org.springframework.web.multipart.MultipartResolver; SearchStrategy: all) did not find any beans (OnBeanCondition) NoOpCacheConfiguration matched: - Cache org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration automatic cache type (CacheCondition) PersistenceExceptionTranslationAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) PersistenceExceptionTranslationAutoConfiguration#persistenceExceptionTranslationPostProcessor matched: - @ConditionalOnProperty (spring.dao.exceptiontranslation.enabled) matched (OnPropertyCondition) - @ConditionalOnMissingBean (types: org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; SearchStrategy: all) did not find any beans (OnBeanCondition) PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched: - @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition) QuartzAutoConfiguration matched: - @ConditionalOnClass found required classes 'org.quartz.Scheduler', 'org.springframework.scheduling.quartz.SchedulerFactoryBean', 'org.springframework.transaction.PlatformTransactionManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) QuartzAutoConfiguration#quartzScheduler matched: - @ConditionalOnMissingBean (types: org.springframework.scheduling.quartz.SchedulerFactoryBean; SearchStrategy: all) did not find any beans (OnBeanCondition) RestTemplateAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.web.client.RestTemplate'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) RestTemplateAutoConfiguration#restTemplateBuilder matched: - @ConditionalOnMissingBean (types: org.springframework.boot.web.client.RestTemplateBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition) ServletWebServerFactoryAutoConfiguration matched: - @ConditionalOnClass found required class 'javax.servlet.ServletRequest'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) ServletWebServerFactoryAutoConfiguration#tomcatServletWebServerFactoryCustomizer matched: - @ConditionalOnClass found required class 'org.apache.catalina.startup.Tomcat'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) ServletWebServerFactoryConfiguration.EmbeddedTomcat matched: - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.apache.catalina.startup.Tomcat', 'org.apache.coyote.UpgradeProtocol'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.server.ServletWebServerFactory; SearchStrategy: current) did not find any beans (OnBeanCondition) SimpleCacheConfiguration matched: - Cache org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration automatic cache type (CacheCondition) TransactionAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.transaction.PlatformTransactionManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) TransactionAutoConfiguration#platformTransactionManagerCustomizers matched: - @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; SearchStrategy: all) did not find any beans (OnBeanCondition) ValidationAutoConfiguration matched: - @ConditionalOnClass found required class 'javax.validation.executable.ExecutableValidator'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - @ConditionalOnResource found location classpath:META-INF/services/javax.validation.spi.ValidationProvider (OnResourceCondition) ValidationAutoConfiguration#defaultValidator matched: - @ConditionalOnMissingBean (types: javax.validation.Validator; SearchStrategy: all) did not find any beans (OnBeanCondition) ValidationAutoConfiguration#methodValidationPostProcessor matched: - @ConditionalOnMissingBean (types: org.springframework.validation.beanvalidation.MethodValidationPostProcessor; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration matched: - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'org.springframework.web.servlet.DispatcherServlet', 'org.springframework.web.servlet.config.annotation.WebMvcConfigurer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) - @ConditionalOnMissingBean (types: org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration#hiddenHttpMethodFilter matched: - @ConditionalOnMissingBean (types: org.springframework.web.filter.HiddenHttpMethodFilter; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration#httpPutFormContentFilter matched: - @ConditionalOnProperty (spring.mvc.formcontent.putfilter.enabled) matched (OnPropertyCondition) - @ConditionalOnMissingBean (types: org.springframework.web.filter.HttpPutFormContentFilter; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#defaultViewResolver matched: - @ConditionalOnMissingBean (types: org.springframework.web.servlet.view.InternalResourceViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#requestContextFilter matched: - @ConditionalOnMissingBean (types: org.springframework.web.context.request.RequestContextListener,org.springframework.web.filter.RequestContextFilter; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#viewResolver matched: - @ConditionalOnBean (types: org.springframework.web.servlet.ViewResolver; SearchStrategy: all) found beans 'defaultViewResolver', 'beanNameViewResolver', 'mvcViewResolver'; @ConditionalOnMissingBean (names: viewResolver; types: org.springframework.web.servlet.view.ContentNegotiatingViewResolver; SearchStrategy: all) did not find any beans (OnBeanCondition) WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter.FaviconConfiguration matched: - @ConditionalOnProperty (spring.mvc.favicon.enabled) matched (OnPropertyCondition) WebSocketServletAutoConfiguration matched: - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'javax.websocket.server.ServerContainer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - found ConfigurableWebEnvironment (OnWebApplicationCondition) WebSocketServletAutoConfiguration.TomcatWebSocketConfiguration matched: - @ConditionalOnClass found required classes 'org.apache.catalina.startup.Tomcat', 'org.apache.tomcat.websocket.server.WsSci'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) WebSocketServletAutoConfiguration.TomcatWebSocketConfiguration#websocketContainerCustomizer matched: - @ConditionalOnMissingBean (names: websocketServletWebServerCustomizer; SearchStrategy: all) did not find any beans (OnBeanCondition) Negative matches: ----------------- ActiveMQAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.ActiveMQConnectionFactory' (OnClassCondition) AopAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.aspectj.lang.annotation.Aspect', 'org.aspectj.lang.reflect.Advice', 'org.aspectj.weaver.AnnotatedElement' (OnClassCondition) ArtemisAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory' (OnClassCondition) BatchAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.batch.core.launch.JobLauncher', 'org.springframework.jdbc.core.JdbcOperations' (OnClassCondition) CacheAutoConfiguration: Did not match: - @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) did not find any beans of type org.springframework.cache.interceptor.CacheAspectSupport (OnBeanCondition) Matched: - @ConditionalOnClass found required class 'org.springframework.cache.CacheManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) CacheAutoConfiguration.CacheManagerJpaDependencyConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition) - Ancestor org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition) CaffeineCacheConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.github.benmanes.caffeine.cache.Caffeine' (OnClassCondition) CassandraAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.datastax.driver.core.Cluster' (OnClassCondition) CassandraDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Cluster', 'org.springframework.data.cassandra.core.CassandraAdminOperations' (OnClassCondition) CassandraReactiveDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Cluster', 'org.springframework.data.cassandra.core.ReactiveCassandraTemplate', 'reactor.core.publisher.Flux' (OnClassCondition) CassandraReactiveRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.data.cassandra.ReactiveSession', 'org.springframework.data.cassandra.repository.ReactiveCassandraRepository' (OnClassCondition) CassandraRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.datastax.driver.core.Session', 'org.springframework.data.cassandra.repository.CassandraRepository' (OnClassCondition) CloudAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.cloud.config.java.CloudScanConfiguration' (OnClassCondition) CouchbaseAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.CouchbaseBucket', 'com.couchbase.client.java.Cluster' (OnClassCondition) CouchbaseCacheConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'com.couchbase.client.spring.cache.CouchbaseCacheManager' (OnClassCondition) CouchbaseDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.CouchbaseRepository' (OnClassCondition) CouchbaseReactiveDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository', 'reactor.core.publisher.Flux' (OnClassCondition) CouchbaseReactiveRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository', 'reactor.core.publisher.Flux' (OnClassCondition) CouchbaseRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.couchbase.client.java.Bucket', 'org.springframework.data.couchbase.repository.CouchbaseRepository' (OnClassCondition) DataSourceAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType' (OnClassCondition) DataSourceTransactionManagerAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.jdbc.core.JdbcTemplate' (OnClassCondition) DispatcherServletAutoConfiguration.DispatcherServletConfiguration#multipartResolver: Did not match: - @ConditionalOnBean (types: org.springframework.web.multipart.MultipartResolver; SearchStrategy: all) did not find any beans of type org.springframework.web.multipart.MultipartResolver (OnBeanCondition) EhCacheCacheConfiguration: Did not match: - @ConditionalOnClass did not find required class 'net.sf.ehcache.Cache' (OnClassCondition) ElasticsearchAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.client.TransportClientFactoryBean' (OnClassCondition) ElasticsearchDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.core.ElasticsearchTemplate' (OnClassCondition) ElasticsearchRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.elasticsearch.client.Client', 'org.springframework.data.elasticsearch.repository.ElasticsearchRepository' (OnClassCondition) EmbeddedLdapAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.unboundid.ldap.listener.InMemoryDirectoryServer' (OnClassCondition) EmbeddedMongoAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'de.flapdoodle.embed.mongo.MongodStarter' (OnClassCondition) EmbeddedWebServerFactoryCustomizerAutoConfiguration.JettyWebServerFactoryCustomizerConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.eclipse.jetty.server.Server', 'org.eclipse.jetty.util.Loader', 'org.eclipse.jetty.webapp.WebAppContext' (OnClassCondition) EmbeddedWebServerFactoryCustomizerAutoConfiguration.UndertowWebServerFactoryCustomizerConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'io.undertow.Undertow', 'org.xnio.SslClientAuthMode' (OnClassCondition) ErrorWebFluxAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition) FlywayAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.flywaydb.core.Flyway' (OnClassCondition) FreeMarkerAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'freemarker.template.Configuration' (OnClassCondition) GroovyTemplateAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'groovy.text.markup.MarkupTemplateEngine' (OnClassCondition) GsonAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition) GsonHttpMessageConvertersConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.google.gson.Gson' (OnClassCondition) H2ConsoleAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.h2.server.web.WebServlet' (OnClassCondition) HazelcastAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.hazelcast.core.HazelcastInstance' (OnClassCondition) HazelcastCacheConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.hazelcast.core.HazelcastInstance', 'com.hazelcast.spring.cache.HazelcastCacheManager' (OnClassCondition) HazelcastJpaDependencyAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.hazelcast.core.HazelcastInstance', 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean' (OnClassCondition) HibernateJpaAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean', 'javax.persistence.EntityManager' (OnClassCondition) HttpHandlerAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.DispatcherHandler' (OnClassCondition) HypermediaAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.hateoas.Resource' (OnClassCondition) InfinispanCacheConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.infinispan.spring.provider.SpringEmbeddedCacheManager' (OnClassCondition) InfluxDbAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.influxdb.InfluxDB' (OnClassCondition) IntegrationAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.integration.config.EnableIntegration' (OnClassCondition) JCacheCacheConfiguration: Did not match: - @ConditionalOnClass did not find required class 'javax.cache.Caching' (OnClassCondition) JacksonAutoConfiguration.JodaDateTimeJacksonConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.joda.time.DateTime', 'com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer', 'com.fasterxml.jackson.datatype.joda.cfg.JacksonJodaDateFormat' (OnClassCondition) JacksonHttpMessageConvertersConfiguration.MappingJackson2XmlHttpMessageConverterConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.fasterxml.jackson.dataformat.xml.XmlMapper' (OnClassCondition) JdbcTemplateAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.jdbc.core.JdbcTemplate' (OnClassCondition) JerseyAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.glassfish.jersey.server.spring.SpringComponentProvider' (OnClassCondition) JestAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'io.searchbox.client.JestClient' (OnClassCondition) JmsAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'javax.jms.Message', 'org.springframework.jms.core.JmsTemplate' (OnClassCondition) JndiConnectionFactoryAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.jms.core.JmsTemplate' (OnClassCondition) JndiDataSourceAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType' (OnClassCondition) JooqAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.jooq.DSLContext' (OnClassCondition) JpaRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.jpa.repository.JpaRepository' (OnClassCondition) JsonbAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition) JsonbHttpMessageConvertersConfiguration: Did not match: - @ConditionalOnClass did not find required class 'javax.json.bind.Jsonb' (OnClassCondition) JtaAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'javax.transaction.Transaction' (OnClassCondition) KafkaAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.kafka.core.KafkaTemplate' (OnClassCondition) LdapAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.ldap.core.ContextSource' (OnClassCondition) LdapDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition) LdapRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.ldap.repository.LdapRepository' (OnClassCondition) LiquibaseAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'liquibase.integration.spring.SpringLiquibase', 'liquibase.change.DatabaseChange' (OnClassCondition) MailSenderAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'javax.mail.internet.MimeMessage' (OnClassCondition) MailSenderValidatorAutoConfiguration: Did not match: - @ConditionalOnProperty (spring.mail.test-connection) did not find property 'test-connection' (OnPropertyCondition) MessageSourceAutoConfiguration: Did not match: - ResourceBundle did not find bundle with basename messages (MessageSourceAutoConfiguration.ResourceBundleCondition) MongoAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.mongodb.MongoClient' (OnClassCondition) MongoDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'org.springframework.data.mongodb.core.MongoTemplate' (OnClassCondition) MongoReactiveAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.mongodb.reactivestreams.client.MongoClient' (OnClassCondition) MongoReactiveDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.mongodb.reactivestreams.client.MongoClient', 'org.springframework.data.mongodb.core.ReactiveMongoTemplate' (OnClassCondition) MongoReactiveRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.mongodb.reactivestreams.client.MongoClient', 'org.springframework.data.mongodb.repository.ReactiveMongoRepository' (OnClassCondition) MongoRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'com.mongodb.MongoClient', 'org.springframework.data.mongodb.repository.MongoRepository' (OnClassCondition) MustacheAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.samskivert.mustache.Mustache' (OnClassCondition) Neo4jDataAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.neo4j.ogm.session.SessionFactory', 'org.springframework.data.neo4j.transaction.Neo4jTransactionManager' (OnClassCondition) Neo4jRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.neo4j.ogm.session.Neo4jSession', 'org.springframework.data.neo4j.repository.Neo4jRepository' (OnClassCondition) OAuth2ClientAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.security.config.annotation.web.configuration.EnableWebSecurity', 'org.springframework.security.oauth2.client.registration.ClientRegistration' (OnClassCondition) ProjectInfoAutoConfiguration#buildProperties: Did not match: - @ConditionalOnResource did not find resource '${spring.info.build.location:classpath:META-INF/build-info.properties}' (OnResourceCondition) ProjectInfoAutoConfiguration#gitProperties: Did not match: - GitResource did not find git info at classpath:git.properties (ProjectInfoAutoConfiguration.GitResourceAvailableCondition) QuartzAutoConfiguration.JdbcStoreTypeConfiguration: Did not match: - @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans (OnBeanCondition) RabbitAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.amqp.rabbit.core.RabbitTemplate', 'com.rabbitmq.client.Channel' (OnClassCondition) ReactiveUserDetailsServiceAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.ReactiveAuthenticationManager' (OnClassCondition) ReactiveWebServerFactoryAutoConfiguration: Did not match: - not a reactive web application (OnWebApplicationCondition) Matched: - @ConditionalOnClass found required class 'org.springframework.http.ReactiveHttpInputMessage'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) ReactorCoreAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'reactor.core.publisher.Mono', 'reactor.core.publisher.Flux' (OnClassCondition) RedisAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.redis.core.RedisOperations' (OnClassCondition) RedisCacheConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.redis.connection.RedisConnectionFactory' (OnClassCondition) RedisReactiveAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.data.redis.connection.ReactiveRedisConnectionFactory', 'org.springframework.data.redis.core.ReactiveRedisTemplate', 'reactor.core.publisher.Flux' (OnClassCondition) RedisRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.redis.repository.configuration.EnableRedisRepositories' (OnClassCondition) RepositoryRestMvcAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration' (OnClassCondition) SecurityAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.DefaultAuthenticationEventPublisher' (OnClassCondition) SecurityFilterAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer', 'org.springframework.security.config.http.SessionCreationPolicy' (OnClassCondition) SendGridAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'com.sendgrid.SendGrid' (OnClassCondition) ServletWebServerFactoryConfiguration.EmbeddedJetty: Did not match: - @ConditionalOnClass did not find required classes 'org.eclipse.jetty.server.Server', 'org.eclipse.jetty.util.Loader', 'org.eclipse.jetty.webapp.WebAppContext' (OnClassCondition) ServletWebServerFactoryConfiguration.EmbeddedUndertow: Did not match: - @ConditionalOnClass did not find required classes 'io.undertow.Undertow', 'org.xnio.SslClientAuthMode' (OnClassCondition) SessionAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.session.Session' (OnClassCondition) SolrAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.apache.solr.client.solrj.impl.HttpSolrClient', 'org.apache.solr.client.solrj.impl.CloudSolrClient' (OnClassCondition) SolrRepositoriesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.apache.solr.client.solrj.SolrClient', 'org.springframework.data.solr.repository.SolrRepository' (OnClassCondition) SpringApplicationAdminJmxAutoConfiguration: Did not match: - @ConditionalOnProperty (spring.application.admin.enabled=true) did not find property 'enabled' (OnPropertyCondition) SpringDataWebAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.data.web.PageableHandlerMethodArgumentResolver' (OnClassCondition) ThymeleafAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.thymeleaf.templatemode.TemplateMode' (OnClassCondition) TransactionAutoConfiguration.EnableTransactionManagementConfiguration: Did not match: - @ConditionalOnBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) did not find any beans of type org.springframework.transaction.PlatformTransactionManager (OnBeanCondition) TransactionAutoConfiguration.EnableTransactionManagementConfiguration.CglibAutoProxyConfiguration: Did not match: - Ancestor org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition) Matched: - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition) TransactionAutoConfiguration.EnableTransactionManagementConfiguration.JdkDynamicAutoProxyConfiguration: Did not match: - @ConditionalOnProperty (spring.aop.proxy-target-class=false) did not find property 'proxy-target-class' (OnPropertyCondition) - Ancestor org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition) TransactionAutoConfiguration.TransactionTemplateConfiguration: Did not match: - @ConditionalOnSingleCandidate (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) did not find any beans (OnBeanCondition) UserDetailsServiceAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.security.authentication.AuthenticationManager' (OnClassCondition) WebClientAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.function.client.WebClient' (OnClassCondition) WebFluxAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition) WebFluxSecurityConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity', 'org.springframework.security.web.server.WebFilterChainProxy' (OnClassCondition) WebMvcAutoConfiguration.ResourceChainCustomizerConfiguration: Did not match: - @ConditionalOnEnabledResourceChain did not find class org.webjars.WebJarAssetLocator (OnEnabledResourceChainCondition) WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#beanNameViewResolver: Did not match: - @ConditionalOnMissingBean (types: org.springframework.web.servlet.view.BeanNameViewResolver; SearchStrategy: all) found beans of type 'org.springframework.web.servlet.view.BeanNameViewResolver' beanNameViewResolver (OnBeanCondition) WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter#localeResolver: Did not match: - @ConditionalOnProperty (spring.mvc.locale) did not find property 'locale' (OnPropertyCondition) WebServicesAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.ws.transport.http.MessageDispatcherServlet' (OnClassCondition) WebSocketMessagingAutoConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer' (OnClassCondition) WebSocketReactiveAutoConfiguration: Did not match: - not a reactive web application (OnWebApplicationCondition) Matched: - @ConditionalOnClass found required classes 'javax.servlet.Servlet', 'javax.websocket.server.ServerContainer'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) WebSocketServletAutoConfiguration.JettyWebSocketConfiguration: Did not match: - @ConditionalOnClass did not find required class 'org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer' (OnClassCondition) WebSocketServletAutoConfiguration.UndertowWebSocketConfiguration: Did not match: - @ConditionalOnClass did not find required class 'io.undertow.websockets.jsr.Bootstrap' (OnClassCondition) XADataSourceAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'javax.transaction.TransactionManager', 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType' (OnClassCondition) Exclusions: ----------- None Unconditional classes: ---------------------- org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration ``` ```
PHP大神请进,解答一下我项目中的报错!!!!
<div> <p>我穷,只能把全部财富值给你们。</p> <p>问题链接:[composer_install](https://learnku.com/laravel/t/16839 "composer_install") </p> <p>下面是问题在执行composer install时候报的这个错</p> </div><br/> Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover In ProviderRepository.php line 208: Class 'Ghub\Perform\ServiceProvider' not found Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1 </br> </br> <P>这个是我的composer.json 文件的配置</P></br> </br> { "name": "baidu/ghub-laravel", "description": "test.com.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=7.1.3", "elasticsearch/elasticsearch": "~5.0", "fideloper/proxy": "~4.0", "firebase/php-jwt": "~3.0|~4.0", "guzzlehttp/guzzle": "~6.0", "laravel/framework": "5.7.*", "laravel/tinker": "~1.0", "league/oauth2-server": "^6.0", "nexmo/client": "2.0.0", "phpseclib/phpseclib": "^2.0", "ggoop/gmf-sys": "dev-master", "simplesoftwareio/simple-qrcode": "~2", "symfony/psr-http-message-bridge": "~1.0", "zendframework/zend-diactoros": "~1.0", "kylekatarnls/laravel-carbon-2": "^1.0.0", "nesbot/carbon": "2.16.3 as 1.34.0" }, "require-dev": { "doctrine/dbal": "^2.5", "filp/whoops": "~2.0", "fzaninotto/faker": "~1.4", "hisorange/browser-detect": "^3.1", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~6.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/", "Ghub\\Sans\\":"../ghub-sans/src/", "Ghub\\Stage\\":"../ghub-stage/src/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "gmf-install": [ "php -r \"file_exists('.env') || copy('.env.example', '.env');\"", "php artisan key:generate", "php artisan storage:link", "php artisan passport:keys" ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } } } </br> </br> [2019-10-24 12:42:52] laravel.ERROR: Class 'Ghub\Perform\ServiceProvider' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Ghub\\Perform\\ServiceProvider' not found at D:\\WorkSpace\\WorkSpace3\\ghub-laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRepository.php:208) [stacktrace] </p> <br/> <div> 是不是require里版本的问题?该怎么解决呢?着急中...... </div>
es查询很慢,求优化方法
集群现在5个master、3个client、8个data,master和client都是16核cpu、data是8核cpu,都开了超线程,内存都128G,jvm内存xms和xmx都设置30G。elasticsearch.yml见[elasticsearch.yml](https://elasticsearch.cn/file/download/file_name-ZWxhc3RpY3NlYXJjaC55bWxfLnJhcg==__url-aHR0cHM6Ly9lbGFzdGljc2VhcmNoLmNuL3VwbG9hZHMvcXVlc3Rpb25zLzIwMTgwNzE1LzhhNmUwZTU2NjJmYWQ1NGIzNDFkYmNiMThlYjkzOTAx "elasticsearch.yml")。 索引按小时分表,每个索引是5千万-1.2亿条记录,每条记录30个字段。索引会预先建立好mapping,语句如下: curl -XPUT "http://node1:9200/transcode_2018071401&quot; -d '{"settings" : {"number_of_shards" : 5,"number_of_replicas" : 1, "index.refresh_interval":"30s","index.translog.sync_interval":"5s","index.translog.flush_threshold_size":"4096mb", "index.translog.durability": "async","index.unassigned.node_left.delayed_timeout":"5m"},"aliases":{"transcode_20180714":{},"transcode_201807":{}},"mappings":{"data":{"properties":{"time":{"type":"integer"},"pkgCount":{"type":"integer"},"bytesNum":{"type":"integer"},"stream_id":{"type":"keyword","norms": false}}}}}' -H "Content-type:application/json" 用java程序多线程并行插入数据,插入时指定了routing,值为stream_id字段的值,每秒大概2.5w条数据。 现在需要查询某个时间段内,按照字段stream_id和ip字段的int_ip(ip为struct结构)的值过滤,返回大量的数据(因为前端要用折线图展示,得一下子返回全量数据),查最近两三个小时的数,大概有10000条吧。 目前的处理方式是,在代码里,根据时间段,找到对应的几个小时索引,然后一个索引一个请求 curl node1:9200/_search/ xxx ,多个请求同时发出,并行查询,再对返回的多个结果进行汇总。查询的时候按stream_id字段值路由,请求语句如下: curl "http://node1:9200/transcode_20 ... ot%3B -X GET -H "Content-type:application/json" -d '{"size":"1001","query":{"bool":{"filter":{"bool":{"must":[{"term":{"stream_id":"jcd9734d813ad"}},{"term":{"ip.int_ip":-776921847}},{"range":{"time":{"from":1531647004,"to":null}}}]}}}},"_source":{"includes":["ip","time","pkgCount","bytesNum"]},"sort":[{"_doc":{"order":"asc"}}]}' 第一次拉取,返回的数据都是几百条的情况下,耗时慢的要十几秒,快的几百毫秒 然后拿到一批返回的_scroll_id, 同样对这批_scroll_id并行使用: curl "http://node1:9200/_search/scroll&quot; -X GET -H "Content-type:application/json" -d \'{"scroll":"30s","scroll_id":"'.$scrollId.'"}\'' 查询,再对返回的_scroll_id并行查询,直到拉完数据。 这步的速度也不稳定,一次拉取有的时候只要几百毫秒,有的时候要一两秒。 跪求优化建议
spring-data-elasticsearch 一对多
现在有三个实体类 关系是一个产品有多个属性 一个属性有多个属性值 如下: 实体类EsProduct: ``` @Document(indexName = "product", type = "productInfo",shards = 2,replicas = 1,refreshInterval = "-1") public class EsProduct implements Serializable { private static final long serialVersionUID = 2372551074091780419L; @Id private Long id; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String productSn; private Long brandId; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String brandName; private Long productCategoryId; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String productName; private Long sale; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String subTitle; private BigDecimal price; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String keywords; private List<EsProductAttribute> attributeList; private EsProductCategory productCategorie; ``` 实体类EsProductAttribute: ``` public class EsProductAttribute implements Serializable { private static final long serialVersionUID = 4965902919813623705L; @Id private Long id; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String paProductAttributeName;//属性名称 private List<EsProductAttributeValue> attributeValues; ``` 实体类EsProductAttributeValue: ``` public class EsProductAttributeValue implements Serializable { private static final long serialVersionUID = 6713756365860464751L; private Long id; @Field(analyzer = "ik_max_word",type = FieldType.Text) private String pavProductAttributeValue; ``` 之前的搜索是这样的,可以成功搜索 控制层代码: ``` @ApiOperation(value = "简单搜索:根据关键字,品牌名称或者产品名称,产品编号,副标题搜索(字符串:Text类型最大拆分)") @RequestMapping(value = "/search/keyword", method = RequestMethod.GET) @ResponseBody public CommonResult<CommonPage<EsProduct>> searchKeyword(@RequestParam(required = false) String keyword, @RequestParam(required = false, defaultValue = "0") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize) { Page<EsProduct> esProductPage = esProductService.searchKeyword(keyword, pageNum, pageSize); return CommonResult.success(CommonPage.restPage(esProductPage)); } ``` 业务实现层代码: ``` @Autowired private EsProductRepository productRepository; @Override public Page<EsProduct> searchKeyword(String keyword, Integer pageNum, Integer pageSize) { Pageable pageable = PageRequest.of(pageNum, pageSize); return productRepository.findByKeywordsOrProductNameOrBrandNameOrProductSnOrSubTitle(keyword,keyword,keyword,keyword,keyword,pageable); } ``` EsProductRepository接口 ``` public interface EsProductRepository extends ElasticsearchRepository<EsProduct, Long> { /** * 根据关键字,产品名称,品牌名称,产品编号搜索 * @param keywords * @param productName * @param brandName * @param page * @return */ Page<EsProduct> findByKeywordsOrProductNameOrBrandNameOrProductSnOrSubTitle(String keywords,String productName,String brandName,String productSn,String subTitle,Pageable page); } ``` 都可以成功搜索 但是在进行属性和属性值搜索的时候告诉我说在EsProduct中找不到paProductAttributeName,我一想有道理,然后改变策略 单独写了一个接口测试 控制层 ``` @ApiOperation(value = "属性和属性值搜索、筛选、排序") @ApiImplicitParam(name = "sort", value = "排序字段:0->按相关度;1->按销量;2->价格从低到高;3->价格从高到低", defaultValue = "0", allowableValues = "0,1,2,3", paramType = "query", dataType = "integer") @RequestMapping(value = "/search", method = RequestMethod.GET) @ResponseBody public CommonResult<CommonPage<EsProduct>> search(@RequestParam(required = false) String keyword, @RequestParam(required = false, defaultValue = "0") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize, @RequestParam(required = false, defaultValue = "0") Integer sort) { Page<EsProduct> esProductPage = esProductService.search(keyword,pageNum, pageSize, sort); return CommonResult.success(CommonPage.restPage(esProductPage)); } ``` 业务实现层: ``` @Override public Page<EsProduct> search(String keyword,Integer pageNum, Integer pageSize,Integer sort) { Pageable pageable = PageRequest.of(pageNum, pageSize); //将连接条件和聚合函数等组合 NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder(); //分页 nativeSearchQueryBuilder.withPageable(pageable); //搜索 if (StringUtils.isEmpty(keyword)) { nativeSearchQueryBuilder.withQuery(QueryBuilders.matchAllQuery()); } else { List<FunctionScoreQueryBuilder.FilterFunctionBuilder> filterFunctionBuilders = new ArrayList<>(); //QueryBuilders:简单的静态工厂”导入静态”使用。主要作用是查询条件(关系),如区间\精确\多值等条件 //属性名称 filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("paProductAttributeName", keyword), ScoreFunctionBuilders.weightFactorFunction(2))); //属性值 filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("value", keyword), ScoreFunctionBuilders.weightFactorFunction(2))); //产品名称 // filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("productName",keyword), // ScoreFunctionBuilders.weightFactorFunction(2))); // //关键字 // filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("keywords", keyword), // ScoreFunctionBuilders.weightFactorFunction(2))); // //产品编号 // filterFunctionBuilders.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(QueryBuilders.matchQuery("productSn", keyword), // ScoreFunctionBuilders.weightFactorFunction(2))); FunctionScoreQueryBuilder.FilterFunctionBuilder[] builders = new FunctionScoreQueryBuilder.FilterFunctionBuilder[filterFunctionBuilders.size()]; filterFunctionBuilders.toArray(builders); FunctionScoreQueryBuilder functionScoreQueryBuilder = QueryBuilders.functionScoreQuery(builders) .scoreMode(FunctionScoreQuery.ScoreMode.SUM) .setMinScore(2); nativeSearchQueryBuilder.withQuery(functionScoreQueryBuilder); } // //排序 // if(sort==1){ // //按销量从高到低 // nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("sale").order(SortOrder.DESC)); // }else if(sort==2){ // //按价格从低到高 // nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("price").order(SortOrder.ASC)); // }else if(sort==3){ // //按价格从高到低 // nativeSearchQueryBuilder.withSort(SortBuilders.fieldSort("price").order(SortOrder.DESC)); // }else{ // //按相关度 // nativeSearchQueryBuilder.withSort(SortBuilders.scoreSort().order(SortOrder.DESC)); // } nativeSearchQueryBuilder.withSort(SortBuilders.scoreSort().order(SortOrder.DESC)); NativeSearchQuery searchQuery = nativeSearchQueryBuilder.build(); LOGGER.info("DSL:{}", searchQuery.getQuery().toString()); return productRepository.search(searchQuery); } ``` es中的数据是: ``` { "code": 200, "message": "操作成功", "data": { "pageNum": 0, "pageSize": 5, "totalPage": 4, "total": 17, "list": [ { "id": 40, "productSn": "C146179 ", "brandId": null, "brandName": "PSA(信昌电陶)", "productCategoryId": 54, "productName": "贴片电容/220nF(224)±10%250V编带", "sale": 1000, "subTitle": "贴片电容", "price": null, "keywords": "贴片电容/220nF(224) ±10% 250V 编带 ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 240, "pavProductAttributeValue": "0.1pf" }, { "id": 241, "pavProductAttributeValue": "0.2pf" }, { "id": 242, "pavProductAttributeValue": "0.25pf" }, { "id": 243, "pavProductAttributeValue": "0.3pf" }, { "id": 244, "pavProductAttributeValue": "0.4pf" } ] }, { "id": 51, "paProductAttributeName": "额定电压", "attributeValues": [ { "id": 290, "pavProductAttributeValue": "4v" }, { "id": 292, "pavProductAttributeValue": "10v" }, { "id": 296, "pavProductAttributeValue": "30v" } ] } ], "productCategorie": { "id": 54, "productCategoryName": "贴片电容" } }, { "id": 41, "productSn": "C394163 ", "brandId": null, "brandName": "PSA(信昌电陶)", "productCategoryId": 54, "productName": "贴片电容/10nF(103) ±10% 1KV", "sale": 1000, "subTitle": "贴片电容", "price": null, "keywords": "贴片电容/10nF(103) ±10% 1KV ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 245, "pavProductAttributeValue": "0.5pf" }, { "id": 246, "pavProductAttributeValue": "0.6pf" }, { "id": 247, "pavProductAttributeValue": "0.68pf" } ] }, { "id": 50, "paProductAttributeName": "精度", "attributeValues": [ { "id": 272, "pavProductAttributeValue": "+0.05pf" }, { "id": 273, "pavProductAttributeValue": "+0.1pf" }, { "id": 274, "pavProductAttributeValue": "+0.25pf" } ] }, { "id": 51, "paProductAttributeName": "额定电压", "attributeValues": [ { "id": 291, "pavProductAttributeValue": "6.3v" }, { "id": 293, "pavProductAttributeValue": "16v" }, { "id": 297, "pavProductAttributeValue": "35v" } ] } ], "productCategorie": { "id": 54, "productCategoryName": "贴片电容" } }, { "id": 44, "productSn": "C342641 ", "brandId": null, "brandName": "TDK", "productCategoryId": 54, "productName": "贴片电容/47nF(473) ±5% 100V 编带", "sale": 1000, "subTitle": "贴片电容", "price": null, "keywords": "贴片电容/47nF(473) ±5% 100V 编带 ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 254, "pavProductAttributeValue": "1.3pf" }, { "id": 255, "pavProductAttributeValue": "1.4pf" }, { "id": 256, "pavProductAttributeValue": "2pf" }, { "id": 257, "pavProductAttributeValue": "2.1pf" } ] }, { "id": 50, "paProductAttributeName": "精度", "attributeValues": [ { "id": 278, "pavProductAttributeValue": "+5%" } ] } ], "productCategorie": { "id": 54, "productCategoryName": "贴片电容" } }, { "id": 48, "productSn": "C11366 ", "brandId": null, "brandName": " AVX", "productCategoryId": 55, "productName": "钽电容/22uF(226) ±10% 10V", "sale": 1000, "subTitle": "钽电容", "price": null, "keywords": "钽电容/22uF(226) ±10% 10V ", "attributeList": [ { "id": 49, "paProductAttributeName": "容值", "attributeValues": [ { "id": 269, "pavProductAttributeValue": "0.1pf" }, { "id": 270, "pavProductAttributeValue": "0.2pf" } ] }, { "id": 50, "paProductAttributeName": "精度", "attributeValues": [ { "id": 271, "pavProductAttributeValue": "+0.02pf" }, { "id": 284, "pavProductAttributeValue": "-20%,+80%" } ] } ], "productCategorie": { "id": 55, "productCategoryName": "钽电容" } }, { "id": 52, "productSn": "C391913 ", "brandId": null, "brandName": "SAMYOUNG(韩国三莹)", "productCategoryId": 56, "productName": "贴片电解电容/10uF ±20% 50V", "sale": 1000, "subTitle": "贴片电解电容", "price": null, "keywords": "贴片电解电容/10uF ±20% 50V ", "attributeList": [], "productCategorie": { "id": 56, "productCategoryName": "贴片电解电容" } } ] } } ``` 然后搜索了半天一点反应也没有,也没有头绪,求助大神指点
搭建好服务器之后,启动服务器
搭建好服务器之后,启动服务器,出现: DEBUG response status: 404 :/home/tclxa/.virtualenvs/zamboni/lib/python2.6/site-packages/pyelasticsearch/client.py:252 cilent.py文件如下: # -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import datetime from operator import itemgetter from functools import wraps from logging import getLogger import re from six import (iterkeys, binary_type, text_type, string_types, integer_types, iteritems, PY3) from six.moves import xrange try: # PY3 from urllib.parse import urlencode, quote_plus except ImportError: # PY2 from urllib import urlencode, quote_plus import requests import simplejson as json # for use_decimal from simplejson import JSONDecodeError from pyelasticsearch.downtime import DowntimePronePool from pyelasticsearch.exceptions import (Timeout, ConnectionError, ElasticHttpError, InvalidJsonResponseError, ElasticHttpNotFoundError, IndexAlreadyExistsError) def _add_es_kwarg_docs(params, method): """ Add stub documentation for any args in ``params`` that aren't already in the docstring of ``method``. The stubs may not tell much about each arg, but they serve the important purpose of letting the user know that they're safe to use--we won't be paving over them in the future for something pyelasticsearch-specific. """ def docs_for_kwarg(p): return '\n :arg %s: See the ES docs.' % p doc = method.__doc__ if doc is not None: # It's none under python -OO. # Handle the case where there are no :arg declarations to key off: if '\n :arg' not in doc and params: first_param, params = params[0], params[1:] doc = doc.replace('\n (Insert es_kwargs here.)', docs_for_kwarg(first_param)) for p in params: if ('\n :arg %s: ' % p) not in doc: # Find the last documented arg so we can put our generated docs # after it. No need to explicitly compile this; the regex cache # should serve. insertion_point = re.search( r' :arg (.*?)(?=\n+ (?:$|[^: ]))', doc, re.MULTILINE | re.DOTALL).end() doc = ''.join([doc[:insertion_point], docs_for_kwarg(p), doc[insertion_point:]]) method.__doc__ = doc def es_kwargs(*args_to_convert): """ Mark which kwargs will become query string params in the eventual ES call. Return a decorator that grabs the kwargs of the given names, plus any beginning with "es_", subtracts them from the ordinary kwargs, and passes them to the decorated function through the ``query_params`` kwarg. The remaining kwargs and the args are passed through unscathed. Also, if any of the given kwargs are undocumented in the decorated method's docstring, add stub documentation for them. """ convertible_args = set(args_to_convert) def decorator(func): # Add docs for any missing query params: _add_es_kwarg_docs(args_to_convert, func) @wraps(func) def decorate(*args, **kwargs): # Make kwargs the map of normal kwargs and query_params the map of # kwargs destined for query string params: query_params = {} for k in list(iterkeys(kwargs)): # Make a copy; we mutate kwargs. if k.startswith('es_'): query_params[k[3:]] = kwargs.pop(k) elif k in convertible_args: query_params[k] = kwargs.pop(k) return func(*args, query_params=query_params, **kwargs) return decorate return decorator class ElasticSearch(object): """ An object which manages connections to elasticsearch and acts as a go-between for API calls to it This object is thread-safe. You can create one instance and share it among all threads. """ def __init__(self, urls, timeout=60, max_retries=0, revival_delay=300): """ :arg urls: A URL or iterable of URLs of ES nodes. These are full URLs with port numbers, like ``http://elasticsearch.example.com:9200``. :arg timeout: Number of seconds to wait for each request before raising Timeout :arg max_retries: How many other servers to try, in series, after a request times out or a connection fails :arg revival_delay: Number of seconds for which to avoid a server after it times out or is uncontactable """ if isinstance(urls, string_types): urls = [urls] urls = [u.rstrip('/') for u in urls] self.servers = DowntimePronePool(urls, revival_delay) self.revival_delay = revival_delay self.timeout = timeout self.max_retries = max_retries self.logger = getLogger('pyelasticsearch') self.session = requests.session() self.json_encoder = JsonEncoder def _concat(self, items): """ Return a comma-delimited concatenation of the elements of ``items``, with any occurrences of "_all" omitted. If ``items`` is a string, promote it to a 1-item list. """ # TODO: Why strip out _all? if items is None: return '' if isinstance(items, string_types): items = [items] return ','.join(i for i in items if i != '_all') def _to_query(self, obj): """ Convert a native-Python object to a unicode or bytestring representation suitable for a query string. """ # Quick and dirty thus far if isinstance(obj, string_types): return obj if isinstance(obj, bool): return 'true' if obj else 'false' if isinstance(obj, integer_types): return str(obj) if isinstance(obj, float): return repr(obj) # str loses precision. if isinstance(obj, (list, tuple)): return ','.join(self._to_query(o) for o in obj) iso = _iso_datetime(obj) if iso: return iso raise TypeError("_to_query() doesn't know how to represent %r in an ES" ' query string.' % obj) def _utf8(self, thing): """Convert any arbitrary ``thing`` to a utf-8 bytestring.""" if isinstance(thing, binary_type): return thing if not isinstance(thing, text_type): thing = text_type(thing) return thing.encode('utf-8') def _join_path(self, path_components): """ Smush together the path components, omitting '' and None ones. Unicodes get encoded to strings via utf-8. Incoming strings are assumed to be utf-8-encoded already. """ path = '/'.join(quote_plus(self._utf8(p), '') for p in path_components if p is not None and p != '') if not path.startswith('/'): path = '/' + path return path def send_request(self, method, path_components, body='', query_params=None, encode_body=True): """ Send an HTTP request to ES, and return the JSON-decoded response. This is mostly an internal method, but it also comes in handy if you need to use a brand new ES API that isn't yet explicitly supported by pyelasticsearch, while still taking advantage of our connection pooling and retrying. Retry the request on different servers if the first one is down and ``self.max_retries`` > 0. :arg method: An HTTP method, like "GET" :arg path_components: An iterable of path components, to be joined by "/" :arg body: The request body :arg query_params: A map of querystring param names to values or ``None`` :arg encode_body: Whether to encode the body of the request as JSON """ path = self._join_path(path_components) if query_params: path = '?'.join( [path, urlencode(dict((k, self._utf8(self._to_query(v))) for k, v in iteritems(query_params)))]) request_body = self._encode_json(body) if encode_body else body req_method = getattr(self.session, method.lower()) # We do our own retrying rather than using urllib3's; we want to retry # a different node in the cluster if possible, not the same one again # (which may be down). for attempt in xrange(self.max_retries + 1): server_url, was_dead = self.servers.get() url = server_url + path self.logger.debug( "Making a request equivalent to this: curl -X%s '%s' -d '%s'", method, url, request_body) try: resp = req_method( url, timeout=self.timeout, **({'data': request_body} if body else {})) except (ConnectionError, Timeout): self.servers.mark_dead(server_url) self.logger.info('%s marked as dead for %s seconds.', server_url, self.revival_delay) if attempt >= self.max_retries: raise else: if was_dead: self.servers.mark_live(server_url) break self.logger.debug('response status: %s', resp.status_code) print'****************************************************' print resp.status_code print'****************************************************' prepped_response = self._decode_response(resp) if resp.status_code >= 400: self._raise_exception(resp, prepped_response) self.logger.debug('got response %s', prepped_response) return prepped_response def _raise_exception(self, response, decoded_body): """Raise an exception based on an error-indicating response from ES.""" error_message = decoded_body.get('error', decoded_body) error_class = ElasticHttpError if response.status_code == 404: error_class = ElasticHttpNotFoundError elif (error_message.startswith('IndexAlreadyExistsException') or 'nested: IndexAlreadyExistsException' in error_message): error_class = IndexAlreadyExistsError raise error_class(response.status_code, error_message) def _encode_json(self, value): """ Convert a Python value to a form suitable for ElasticSearch's JSON DSL. """ return json.dumps(value, cls=self.json_encoder, use_decimal=True) def _decode_response(self, response): """Return a native-Python representation of a response's JSON blob.""" try: json_response = response.json() except JSONDecodeError: raise InvalidJsonResponseError(response) return json_response ## REST API @es_kwargs('routing', 'parent', 'timestamp', 'ttl', 'percolate', 'consistency', 'replication', 'refresh', 'timeout', 'fields') def index(self, index, doc_type, doc, id=None, overwrite_existing=True, query_params=None): """ Put a typed JSON document into a specific index to make it searchable. :arg index: The name of the index to which to add the document :arg doc_type: The type of the document :arg doc: A Python mapping object, convertible to JSON, representing the document :arg id: The ID to give the document. Leave blank to make one up. :arg overwrite_existing: Whether we should overwrite existing documents of the same ID and doctype :arg routing: A value hashed to determine which shard this indexing request is routed to :arg parent: The ID of a parent document, which leads this document to be routed to the same shard as the parent, unless ``routing`` overrides it. :arg timestamp: An explicit value for the (typically automatic) timestamp associated with a document, for use with ``ttl`` and such :arg ttl: The time until this document is automatically removed from the index. Can be an integral number of milliseconds or a duration like '1d'. :arg percolate: An indication of which percolator queries, registered against this index, should be checked against the new document: '*' or a query string like 'color:green' :arg consistency: An indication of how many active shards the contact node should demand to see in order to let the index operation succeed: 'one', 'quorum', or 'all' :arg replication: Set to 'async' to return from ES before finishing replication. :arg refresh: Pass True to refresh the index after adding the document. :arg timeout: A duration to wait for the relevant primary shard to become available, in the event that it isn't: for example, "5m" See `ES's index API`_ for more detail. .. _`ES's index API`: http://www.elasticsearch.org/guide/reference/api/index_.html """ # :arg query_params: A map of other querystring params to pass along to # ES. This lets you use future ES features without waiting for an # update to pyelasticsearch. If we just used **kwargs for this, ES # could start using a querystring param that we already used as a # kwarg, and we'd shadow it. Name these params according to the names # they have in ES's REST API, but prepend "\es_": for example, # ``es_version=2``. # TODO: Support version along with associated "preference" and # "version_type" params. if not overwrite_existing: query_params['op_type'] = 'create' return self.send_request('POST' if id is None else 'PUT', [index, doc_type, id], doc, query_params) @es_kwargs('consistency', 'refresh') def bulk_index(self, index, doc_type, docs, id_field='id', parent_field='_parent', query_params=None): """ Index a list of documents as efficiently as possible. :arg index: The name of the index to which to add the document :arg doc_type: The type of the document :arg docs: An iterable of Python mapping objects, convertible to JSON, representing documents to index :arg id_field: The field of each document that holds its ID :arg parent_field: The field of each document that holds its parent ID, if any. Removed from document before indexing. See `ES's bulk API`_ for more detail. .. _`ES's bulk API`: http://www.elasticsearch.org/guide/reference/api/bulk.html """ body_bits = [] if not docs: raise ValueError('No documents provided for bulk indexing!') for doc in docs: action = {'index': {'_index': index, '_type': doc_type}} if doc.get(id_field) is not None: action['index']['_id'] = doc[id_field] if doc.get(parent_field) is not None: action['index']['_parent'] = doc.pop(parent_field) body_bits.append(self._encode_json(action)) body_bits.append(self._encode_json(doc)) # Need the trailing newline. body = '\n'.join(body_bits) + '\n' return self.send_request('POST', ['_bulk'], body, encode_body=False, query_params=query_params) @es_kwargs('routing', 'parent', 'replication', 'consistency', 'refresh') def delete(self, index, doc_type, id, query_params=None): """ Delete a typed JSON document from a specific index based on its ID. :arg index: The name of the index from which to delete :arg doc_type: The type of the document to delete :arg id: The (string or int) ID of the document to delete See `ES's delete API`_ for more detail. .. _`ES's delete API`: http://www.elasticsearch.org/guide/reference/api/delete.html """ # id should never be None, and it's not particular dangerous # (equivalent to deleting a doc with ID "None", but it's almost # certainly not what the caller meant: if id is None or id == '': raise ValueError('No ID specified. To delete all documents in ' 'an index, use delete_all().') return self.send_request('DELETE', [index, doc_type, id], query_params=query_params) @es_kwargs('routing', 'parent', 'replication', 'consistency', 'refresh') def delete_all(self, index, doc_type, query_params=None): """ Delete all documents of the given doctype from an index. :arg index: The name of the index from which to delete. ES does not support this being empty or "_all" or a comma-delimited list of index names (in 0.19.9). :arg doc_type: The name of a document type See `ES's delete API`_ for more detail. .. _`ES's delete API`: http://www.elasticsearch.org/guide/reference/api/delete.html """ return self.send_request('DELETE', [index, doc_type], query_params=query_params) @es_kwargs('q', 'df', 'analyzer', 'default_operator', 'source' 'routing', 'replication', 'consistency') def delete_by_query(self, index, doc_type, query, query_params=None): """ Delete typed JSON documents from a specific index based on query. :arg index: An index or iterable thereof from which to delete :arg doc_type: The type of document or iterable thereof to delete :arg query: A dictionary that will convert to ES's query DSL or a string that will serve as a textual query to be passed as the ``q`` query string parameter. (Passing the ``q`` kwarg yourself is deprecated.) See `ES's delete-by-query API`_ for more detail. .. _`ES's delete-by-query API`: http://www.elasticsearch.org/guide/reference/api/delete-by-query.html """ if isinstance(query, string_types) and 'q' not in query_params: query_params['q'] = query body = '' else: body = query return self.send_request( 'DELETE', [self._concat(index), self._concat(doc_type), '_query'], body, query_params=query_params) @es_kwargs('realtime', 'fields', 'routing', 'preference', 'refresh') def get(self, index, doc_type, id, query_params=None): """ Get a typed JSON document from an index by ID. :arg index: The name of the index from which to retrieve :arg doc_type: The type of document to get :arg id: The ID of the document to retrieve See `ES's get API`_ for more detail. .. _`ES's get API`: http://www.elasticsearch.org/guide/reference/api/get.html """ return self.send_request('GET', [index, doc_type, id], query_params=query_params) @es_kwargs() def multi_get(self, ids, index=None, doc_type=None, fields=None, query_params=None): """ Get multiple typed JSON documents from ES. :arg ids: An iterable, each element of which can be either an a dict or an id (int or string). IDs are taken to be document IDs. Dicts are passed through the Multi Get API essentially verbatim, except that any missing ``_type``, ``_index``, or ``fields`` keys are filled in from the defaults given in the ``index``, ``doc_type``, and ``fields`` args. :arg index: Default index name from which to retrieve :arg doc_type: Default type of document to get :arg fields: Default fields to return See `ES's Multi Get API`_ for more detail. .. _`ES's Multi Get API`: http://www.elasticsearch.org/guide/reference/api/multi-get.html """ doc_template = dict( filter( itemgetter(1), [('_index', index), ('_type', doc_type), ('fields', fields)])) docs = [] for id in ids: doc = doc_template.copy() if isinstance(id, dict): doc.update(id) else: doc['_id'] = id docs.append(doc) return self.send_request( 'GET', ['_mget'], {'docs': docs}, query_params=query_params) @es_kwargs('routing', 'parent', 'timeout', 'replication', 'consistency', 'percolate', 'refresh', 'retry_on_conflict', 'fields') def update(self, index, doc_type, id, script=None, params=None, lang=None, query_params=None, doc=None, upsert=None): """ Update an existing document. Raise ``TypeError`` if ``script``, ``doc`` and ``upsert`` are all unspecified. :arg index: The name of the index containing the document :arg doc_type: The type of the document :arg id: The ID of the document :arg script: The script to be used to update the document :arg params: A dict of the params to be put in scope of the script :arg lang: The language of the script. Omit to use the default, specified by ``script.default_lang``. :arg doc: A partial document to be merged into the existing document :arg upsert: The content for the new document created if the document does not exist """ if script is None and doc is None and upsert is None: raise TypeError('At least one of the script, doc, or upsert ' 'kwargs must be provided.') body = {} if script: body['script'] = script if lang and script: body['lang'] = lang if doc: body['doc'] = doc if upsert: body['upsert'] = upsert if params: body['params'] = params return self.send_request( 'POST', [index, doc_type, id, '_update'], body=body, query_params=query_params) def _search_or_count(self, kind, query, index=None, doc_type=None, query_params=None): if isinstance(query, string_types): query_params['q'] = query body = '' else: body = query return self.send_request( 'GET', [self._concat(index), self._concat(doc_type), kind], body, query_params=query_params) @es_kwargs('routing', 'size') def search(self, query, **kwargs): """ Execute a search query against one or more indices and get back search hits. :arg query: A dictionary that will convert to ES's query DSL or a string that will serve as a textual query to be passed as the ``q`` query string parameter :arg index: An index or iterable of indexes to search. Omit to search all. :arg doc_type: A document type or iterable thereof to search. Omit to search all. :arg size: Limit the number of results to ``size``. Use with ``es_from`` to implement paginated searching. See `ES's search API`_ for more detail. .. _`ES's search API`: http://www.elasticsearch.org/guide/reference/api/search/ """ return self._search_or_count('_search', query, **kwargs) @es_kwargs('df', 'analyzer', 'default_operator', 'source', 'routing') def count(self, query, **kwargs): """ Execute a query against one or more indices and get hit count. :arg query: A dictionary that will convert to ES's query DSL or a string that will serve as a textual query to be passed as the ``q`` query string parameter :arg index: An index or iterable of indexes to search. Omit to search all. :arg doc_type: A document type or iterable thereof to search. Omit to search all. See `ES's count API`_ for more detail. .. _`ES's count API`: http://www.elasticsearch.org/guide/reference/api/count.html """ return self._search_or_count('_count', query, **kwargs) @es_kwargs() def get_mapping(self, index=None, doc_type=None, query_params=None): """ Fetch the mapping definition for a specific index and type. :arg index: An index or iterable thereof :arg doc_type: A document type or iterable thereof Omit both arguments to get mappings for all types and indexes. See `ES's get-mapping API`_ for more detail. .. _`ES's get-mapping API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html """ # TODO: Think about turning index=None into _all if doc_type is non- # None, per the ES doc page. return self.send_request( 'GET', [self._concat(index), self._concat(doc_type), '_mapping'], query_params=query_params) @es_kwargs('ignore_conflicts') def put_mapping(self, index, doc_type, mapping, query_params=None): """ Register specific mapping definition for a specific type against one or more indices. :arg index: An index or iterable thereof :arg doc_type: The document type to set the mapping of :arg mapping: A dict representing the mapping to install. For example, this dict can have top-level keys that are the names of doc types. See `ES's put-mapping API`_ for more detail. .. _`ES's put-mapping API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html """ # TODO: Perhaps add a put_all_mappings() for consistency and so we # don't need to expose the "_all" magic string. We haven't done it yet # since this routine is not dangerous: ES makes you explicily pass # "_all" to update all mappings. return self.send_request( 'PUT', [self._concat(index), doc_type, '_mapping'], mapping, query_params=query_params) @es_kwargs('search_type', 'search_indices', 'search_types', 'search_scroll', 'search_size', 'search_from', 'like_text', 'percent_terms_to_match', 'min_term_freq', 'max_query_terms', 'stop_words', 'min_doc_freq', 'max_doc_freq', 'min_word_len', 'max_word_len', 'boost_terms', 'boost', 'analyzer') def more_like_this(self, index, doc_type, id, mlt_fields, body='', query_params=None): """ Execute a "more like this" search query against one or more fields and get back search hits. :arg index: The index to search and where the document for comparison lives :arg doc_type: The type of document to find others like :arg id: The ID of the document to find others like :arg mlt_fields: The list of fields to compare on :arg body: A dictionary that will convert to ES's query DSL and be passed as the request body See `ES's more-like-this API`_ for more detail. .. _`ES's more-like-this API`: http://www.elasticsearch.org/guide/reference/api/more-like-this.html """ query_params['mlt_fields'] = self._concat(mlt_fields) return self.send_request('GET', [index, doc_type, id, '_mlt'], body=body, query_params=query_params) ## Index Admin API @es_kwargs('recovery', 'snapshot') def status(self, index=None, query_params=None): """ Retrieve the status of one or more indices :arg index: An index or iterable thereof See `ES's index-status API`_ for more detail. .. _`ES's index-status API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-status.html """ return self.send_request('GET', [self._concat(index), '_status'], query_params=query_params) @es_kwargs() def update_aliases(self, settings, query_params=None): """ Add, remove, or update aliases in bulk. :arg settings: a dictionary specifying the actions to perform See `ES's admin-indices-aliases API`_. .. _`ES's admin-indices-aliases API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html """ return self.send_request('POST', ['_aliases'], body=settings, query_params=query_params) @es_kwargs() def aliases(self, index=None, query_params=None): """ Retrieve a listing of aliases :arg index: the name of an index or an iterable of indices See `ES's admin-indices-aliases API`_. .. _`ES's admin-indices-aliases API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html """ return self.send_request('GET', [self._concat(index), '_aliases'], query_params=query_params) @es_kwargs() def create_index(self, index, settings=None, query_params=None): """ Create an index with optional settings. :arg index: The name of the index to create :arg settings: A dictionary of settings If the index already exists, raise :class:`~pyelasticsearch.exceptions.IndexAlreadyExistsError`. See `ES's create-index API`_ for more detail. .. _`ES's create-index API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html """ return self.send_request('PUT', [index], body=settings, query_params=query_params) @es_kwargs() def delete_index(self, index, query_params=None): """ Delete an index. :arg index: An index or iterable thereof to delete If the index is not found, raise :class:`~pyelasticsearch.exceptions.ElasticHttpNotFoundError`. See `ES's delete-index API`_ for more detail. .. _`ES's delete-index API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-index.html """ if not index: raise ValueError('No indexes specified. To delete all indexes, use' ' delete_all_indexes().') return self.send_request('DELETE', [self._concat(index)], query_params=query_params) def delete_all_indexes(self, **kwargs): """Delete all indexes.""" return self.delete_index('_all', **kwargs) @es_kwargs() def close_index(self, index, query_params=None): """ Close an index. :arg index: The index to close See `ES's close-index API`_ for more detail. .. _`ES's close-index API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close.html """ return self.send_request('POST', [index, '_close'], query_params=query_params) @es_kwargs() def open_index(self, index, query_params=None): """ Open an index. :arg index: The index to open See `ES's open-index API`_ for more detail. .. _`ES's open-index API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close.html """ return self.send_request('POST', [index, '_open'], query_params=query_params) @es_kwargs() def get_settings(self, index, query_params=None): """ Get the settings of one or more indexes. :arg index: An index or iterable of indexes See `ES's get-settings API`_ for more detail. .. _`ES's get-settings API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-get-settings.html """ return self.send_request('GET', [self._concat(index), '_settings'], query_params=query_params) @es_kwargs() def update_settings(self, index, settings, query_params=None): """ Change the settings of one or more indexes. :arg index: An index or iterable of indexes :arg settings: A dictionary of settings See `ES's update-settings API`_ for more detail. .. _`ES's update-settings API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html """ if not index: raise ValueError('No indexes specified. To update all indexes, use' ' update_all_settings().') # If we implement the "update cluster settings" API, call that # update_cluster_settings(). return self.send_request('PUT', [self._concat(index), '_settings'], body=settings, query_params=query_params) @es_kwargs() def update_all_settings(self, settings, query_params=None): """ Update the settings of all indexes. :arg settings: A dictionary of settings See `ES's update-settings API`_ for more detail. .. _`ES's update-settings API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html """ return self.send_request('PUT', ['_settings'], body=settings, query_params=query_params) @es_kwargs('refresh') def flush(self, index=None, query_params=None): """ Flush one or more indices (clear memory). :arg index: An index or iterable of indexes See `ES's flush API`_ for more detail. .. _`ES's flush API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-flush.html """ return self.send_request('POST', [self._concat(index), '_flush'], query_params=query_params) @es_kwargs() def refresh(self, index=None, query_params=None): """ Refresh one or more indices. :arg index: An index or iterable of indexes See `ES's refresh API`_ for more detail. .. _`ES's refresh API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-refresh.html """ return self.send_request('POST', [self._concat(index), '_refresh'], query_params=query_params) @es_kwargs() def gateway_snapshot(self, index=None, query_params=None): """ Gateway snapshot one or more indices. :arg index: An index or iterable of indexes See `ES's gateway-snapshot API`_ for more detail. .. _`ES's gateway-snapshot API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-gateway-snapshot.html """ return self.send_request( 'POST', [self._concat(index), '_gateway', 'snapshot'], query_params=query_params) @es_kwargs('max_num_segments', 'only_expunge_deletes', 'refresh', 'flush', 'wait_for_merge') def optimize(self, index=None, query_params=None): """ Optimize one or more indices. :arg index: An index or iterable of indexes See `ES's optimize API`_ for more detail. .. _`ES's optimize API`: http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize.html """ return self.send_request('POST', [self._concat(index), '_optimize'], query_params=query_params) @es_kwargs('level', 'wait_for_status', 'wait_for_relocating_shards', 'wait_for_nodes', 'timeout') def health(self, index=None, query_params=None): """ Report on the health of the cluster or certain indices. :arg index: The index or iterable of indexes to examine See `ES's cluster-health API`_ for more detail. .. _`ES's cluster-health API`: http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html """ return self.send_request( 'GET', ['_cluster', 'health', self._concat(index)], query_params=query_params) @es_kwargs('filter_nodes', 'filter_routing_table', 'filter_metadata', 'filter_blocks', 'filter_indices') def cluster_state(self, query_params=None): """ The cluster state API allows to get comprehensive state information of the whole cluster. (Insert es_kwargs here.) See `ES's cluster-state API`_ for more detail. .. _`ES's cluster-state API`: http://www.elasticsearch.org/guide/reference/api/admin-cluster-state.html """ return self.send_request( 'GET', ['_cluster', 'state'], query_params=query_params) @es_kwargs() def percolate(self, index, doc_type, doc, query_params=None): """ Run a JSON document through the registered percolator queries, and return which ones match. :arg index: The name of the index to which the document pretends to belong :arg doc_type: The type the document should be treated as if it has :arg doc: A Python mapping object, convertible to JSON, representing the document Use :meth:`index()` to register percolators. See `ES's percolate API`_ for more detail. .. _`ES's percolate API`: http://www.elasticsearch.org/guide/reference/api/percolate/ """ return self.send_request('GET', [index, doc_type, '_percolate'], doc, query_params=query_params) class JsonEncoder(json.JSONEncoder): def default(self, value): """Convert more Python data types to ES-understandable JSON.""" iso = _iso_datetime(value) if iso: return iso if not PY3 and isinstance(value, str): return unicode(value, errors='replace') # TODO: Be stricter. if isinstance(value, set): return list(value) return super(JsonEncoder, self).default(value) def _iso_datetime(value): """ If value appears to be something datetime-like, return it in ISO format. Otherwise, return None. """ if hasattr(value, 'strftime'): if hasattr(value, 'hour'): return value.isoformat() else: return '%sT00:00:00' % value.isoformat()
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
Python 植物大战僵尸代码实现(2):植物卡片选择和种植
这篇文章要介绍的是: - 上方植物卡片栏的实现。 - 点击植物卡片,鼠标切换为植物图片。 - 鼠标移动时,判断当前在哪个方格中,并显示半透明的植物作为提示。
死磕YOLO系列,YOLOv1 的大脑、躯干和手脚
YOLO 是我非常喜欢的目标检测算法,堪称工业级的目标检测,能够达到实时的要求,它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置,当然,也能预测物体的类别。 之前我有写博文介绍过它,但是每次重新读它的论文,我都有新的收获,为此我准备写一个系列的文章来详尽分析它。这是第一篇,从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址:https://www.c
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
记一次腾讯面试:进程之间究竟有哪些通信方式?如何通信? ---- 告别死记硬背
有一次面试的时候,被问到进程之间有哪些通信方式,不过由于之前没深入思考且整理过,说的并不好。想必大家也都知道进程有哪些通信方式,可是我猜很多人都是靠着”背“来记忆的,所以今天的这篇文章,讲给大家详细着讲解他们是如何通信的,让大家尽量能够理解他们之间的区别、优缺点等,这样的话,以后面试官让你举例子,你也能够顺手拈来。 1、管道 我们来看一条 Linux 的语句 netstat -tulnp | gr...
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片
网络(8)-HTTP、Socket、TCP、UDP的区别和联系
TCP/IP协议是传输层协议,主要解决数据如何在网络中传输,而HTTP是应用层协议,主要解决如何包装数据。 一、TCP与UDP的不同 1. 是否需要建立连接。 UDP在传送数据之前不需要先建立连接;TCP则提供面向连接的服务; 2. 是否需要给出确认 对方的传输层在收到UDP报文后,不需要给出任何确认,而 TCP需要给出确认报文,要提供可靠的、面向连接的传输服务。 3.虽然UDP不提供可靠交...
简明易理解的@SpringBootApplication注解源码解析(包含面试提问)
欢迎关注文章系列 ,关注我 《提升能力,涨薪可待》 《面试知识,工作可待》 《实战演练,拒绝996》 欢迎关注我博客,原创技术文章第一时间推出 也欢迎关注公 众 号【Ccww笔记】,同时推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《提升能力,涨薪可待篇》- @SpringBootApplication注解源码解析 一、@SpringBootApplication 的作用是什
防劝退!数据结构和算法难理解?可视化动画带你轻松透彻理解!
大家好,我是 Rocky0429,一个连数据结构和算法都不会的蒟蒻… 学过数据结构和算法的都知道这玩意儿不好学,没学过的经常听到这样的说法还没学就觉得难,其实难吗?真难! 难在哪呢?当年我还是个小蒟蒻,初学数据结构和算法的时候,在忍着枯燥看完定义原理,之后想实现的时候,觉得它们的过程真的是七拐八绕,及其难受。 在简单的链表、栈和队列这些我还能靠着在草稿上写写画画理解过程,但是到了数论、图...
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给
开挂的人生!那些当选院士,又是ACM/IEEE 双料Fellow的华人学者们
昨日,2019年两院院士正式官宣,一时间抢占了各大媒体头条。 朋友圈也是一片沸腾,奔走相告,赶脚比自己中了大奖还嗨皮! 谁叫咱家导师就是这么厉害呢!!! 而就在最近,新一年度的IEEE/ACM Fellow也将正式公布。 作为学术届的顶级荣誉,不自然地就会将院士与Fellow作比较,到底哪个含金量更高呢? 学术君认为,同样是专业机构对学者的认可,考量标准不一,自然不能一概而论。 但...
聊聊C语言和指针的本质
坐着绿皮车上海到杭州,24块钱,很宽敞,在火车上非正式地聊几句。 很多编程语言都以 “没有指针” 作为自己的优势来宣传,然而,对于C语言,指针却是与生俱来的。 那么,什么是指针,为什么大家都想避开指针。 很简单, 指针就是地址,当一个地址作为一个变量存在时,它就被叫做指针,该变量的类型,自然就是指针类型。 指针的作用就是,给出一个指针,取出该指针指向地址处的值。为了理解本质,我们从计算机模型说起...
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库——点这里跳转 文章目录Python语言高频重点汇总**GitHub面试宝典仓库——点这里跳转**1. 函数-传参2. 元类3. @staticmethod和@classmethod两个装饰器4. 类属性和实例属性5. Python的自省6. 列表、集合、字典推导式7. Python中单下划线和双下划线8. 格式化字符串中的%和format9.
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
代码详解:如何用Python快速制作美观、炫酷且有深度的图表
全文共12231字,预计学习时长35分钟生活阶梯(幸福指数)与人均GDP(金钱)正相关的正则图本文将探讨三种用Python可视化数据的不同方法。以可视化《2019年世界幸福报告》的数据为例,本文用Gapminder和Wikipedia的信息丰富了《世界幸福报告》数据,以探索新的数据关系和可视化方法。《世界幸福报告》试图回答世界范围内影响幸福的因素。报告根据对“坎特里尔阶梯问题”的回答来确定幸...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
(经验分享)作为一名普通本科计算机专业学生,我大学四年到底走了多少弯路
今年正式步入了大四,离毕业也只剩半年多的时间,回想一下大学四年,感觉自己走了不少弯路,今天就来分享一下自己大学的学习经历,也希望其他人能不要走我走错的路。 (一)初进校园 刚进入大学的时候自己完全就相信了高中老师的话:“进入大学你们就轻松了”。因此在大一的时候自己学习的激情早就被抛地一干二净,每天不是在寝室里玩游戏就是出门游玩,不过好在自己大学时买的第一台笔记本性能并不是很好,也没让我彻底沉...
如何写一篇技术博客,谈谈我的看法
前言 只有光头才能变强。 文本已收录至我的GitHub精选文章,欢迎Star:https://github.com/ZhongFuCheng3y/3y 我一直推崇学技术可以写技术博客去沉淀自己的知识,因为知识点实在是太多太多了,通过自己的博客可以帮助自己快速回顾自己学过的东西。 我最开始的时候也是只记笔记,认为自己能看得懂就好。但如果想验证自己是不是懂了,可以写成技术博客。在写技术博客的...
字节跳动面试官这样问消息队列:分布式事务、重复消费、顺序消费,我整理了一下
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
面试还搞不懂redis,快看看这40道面试题(含答案和思维导图)
Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型? 3、使用 Redis 有哪些好处? 4、Redis 相比 Memcached 有哪些优势? 5、Memcache 与 Redis 的区别都有哪些? 6、Redis 是单进程单线程的? 7、一个字符串类型的值能存储最大容量是多少? 8、Redis 的持久化机制是什么?各自的优缺点? 9、Redis 常见性...
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
互联网公司的裁员,能玩出多少种花样?
裁员,也是一门学问,可谓博大精深!以下,是互联网公司的裁员的多种方法:-正文开始-135岁+不予续签的理由:千禧一代网感更强。95后不予通过试用期的理由:已婚已育员工更有责任心。2通知接下来要过苦日子,让一部分不肯同甘共苦的员工自己走人,以“兄弟”和“非兄弟”来区别员工。3强制996。员工如果平衡不了工作和家庭,可在离婚或离职里二选一。4不布置任何工作,但下班前必须提交千字工作日报。5不给活干+...
【设计模式】单例模式的八种写法分析
网上泛滥流传单例模式的写法种类,有说7种的,也有说6种的,当然也不排除说5种的,他们说的有错吗?其实没有对与错,刨根问底,写法终究是写法,其本质精髓大体一致!因此完全没必要去追究写法的多少,有这个时间还不如跟着宜春去网吧偷耳机、去田里抓青蛙得了,一天天的....
《面试宝典》:检验是否为合格的初中级程序员的面试知识点,你都知道了吗?查漏补缺
欢迎关注文章系列,一起学习 《提升能力,涨薪可待篇》 《面试知识,工作可待篇》 《实战演练,拒绝996篇》 也欢迎关注公 众 号【Ccww笔记】,原创技术文章第一时间推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《面试知识,工作可待篇》-Java笔试面试基础知识大全 前言 是不是感觉找工作面试是那么难呢? 在找工作面试应在学习的基础进行总结面试知识点,工作也指日可待,欢...
关于研发效能提升的思考
研发效能提升是最近比较热门的一个话题,本人根据这几年的工作心得,做了一些思考总结,由于个人深度有限,暂且抛转引入。 三要素 任何生产力的提升都离不开这三个因素:人、流程和工具,少了其中任何一个因素都无法实现。 人,即思想,也就是古人说的“道”,道不同不相为谋,是制高点,也是高层建筑的基石。 流程,即方法,也是古人说的“法”。研发效能的提升,也就是要提高投入产出比,既要增加产出,也要减...
微博推荐算法简述
在介绍微博推荐算法之前,我们先聊一聊推荐系统和推荐算法。有这样一些问题:推荐系统适用哪些场景?用来解决什么问题、具有怎样的价值?效果如何衡量? 推荐系统诞生很早,但真正被大家所重视,缘起于以”facebook”为代表的社会化网络的兴起和以“淘宝“为代表的电商的繁荣,”选择“的时代已经来临,信息和物品的极大丰富,让用户如浩瀚宇宙中的小点,无所适从。推荐系统迎来爆发的机会,变得离用户更近: 快...
GitHub 标星 1.6w+,我发现了一个宝藏项目,作为编程新手有福了!
大家好,我是 Rocky0429,一个最近老在 GitHub 上闲逛的蒟蒻… 特别惭愧的是,虽然我很早就知道 GitHub,但是学会逛 GitHub 的时间特别晚。当时一方面是因为菜,看着这种全是英文的东西难受,不知道该怎么去玩,另一方面是一直在搞 ACM,没有做一些工程类的项目,所以想当然的以为和 GitHub 也没什么关系(当然这种想法是错误的)。 后来自己花了一个星期看完了 Pyt...
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问