最近公司项目需要拆分成微服务模式,自己在家玩了下springboot和springcloud。出现以下问题:
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to register:8761 timed out
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118) ~[httpclient-4.5.5.jar:4.5.5]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.5.jar:4.5.5]
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173) ~[jersey-apache-client4-1.19.1.jar:1.19.1]
... 77 common frames omitted
2018-09-15 01:25:57.415 WARN 1049 --- [ main] c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with message: org.apache.http.conn.ConnectTimeoutException: Connect to register:8761 timed out
2018-09-15 01:25:57.416 ERROR 1049 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_OPEN-SERVICE-USER/192.168.1.27:open-service-user:8082 - was unable to refresh its cache! status = Cannot execute request on any known server
以上为报错信息。
以下为项目配置文件:
1.注册中心配置文件:
2.客户端配置文件:
客户端服务可以单独启动,也可以输入地址访问,但是没有在注册中心注册服务,求大神解答!!!