Elasticsearch + Springboot start being given java.net.ConnectException: Connection refused

2019-08-15 15:31:02.536 DEBUG 8890 --- [on(4)-127.0.0.1] o.a.http.impl.nio.client.MainClientExec  : [exchange: 1] start execution
2019-08-15 15:31:02.541 DEBUG 8890 --- [on(4)-127.0.0.1] o.a.h.client.protocol.RequestAddCookies  : CookieSpec selected: default
2019-08-15 15:31:02.550 DEBUG 8890 --- [on(4)-127.0.0.1] o.a.h.client.protocol.RequestAuthCache   : Re-using cached 'basic' auth scheme for http://localhost:9200
2019-08-15 15:31:02.550 DEBUG 8890 --- [on(4)-127.0.0.1] o.a.h.client.protocol.RequestAuthCache   : No credentials for preemptive authentication
2019-08-15 15:31:02.550 DEBUG 8890 --- [on(4)-127.0.0.1] o.a.h.i.n.c.InternalHttpAsyncClient      : [exchange: 1] Request connection for {}->http://localhost:9200
2019-08-15 15:31:02.552 DEBUG 8890 --- [on(4)-127.0.0.1] .n.c.PoolingNHttpClientConnectionManager : Connection request: [route: {}->http://localhost:9200][total kept alive: 0; route allocated: 0 of 10; total allocated: 0 of 30]
2019-08-15 15:31:02.556 DEBUG 8890 --- [pool-2-thread-1] .n.c.PoolingNHttpClientConnectionManager : Connection request failed

java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
    at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
    at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
    at java.lang.Thread.run(Thread.java:748)

 

This should be checked the error in the spring boot startup es the health status of the request and then taking the 9200 port 

My es is installed on the server is not installed locally

The reason being given localhost: 9200 refused to normal because there is no local 

Solution:

      

spring:
    elasticsearch:
        rest:
          uris: ["http://192.168.10.68:9200"]

But what needs to plug it seems as if head I did not use this method to solve the lazy did not go to install the plug 

Directly address the violence with a simple method

management.health.elasticsearch.enabled=false

Direct'm not going to check (this is not recommended)

 

Guess you like

Origin www.cnblogs.com/pqy521/p/11358340.html