springcloud的Eureka启动时报错:Connection refused: connect
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://127.0.0.1:1096/eureka/}
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect
Request execution failed with message: java.net.ConnectException: Connection refused: connect
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
解决方法:
1.使用cmd查看端口没有占用;失败
2.添加了自己是注册中心,不注册自己
eureka:
client:
service-url: # EurekaServer的地址,现在是自己的地址,如果是集群,需要加上其它Server的地址。
defaultZone: http://127.0.0.1:${server.port}/eureka
###自己是注册中心,是否要将自己注册到注册中心去,但是集群的时候需要设置为true
register-with-eureka: false
###自己是注册中心,不需要去检索服务信息
fetch-registry: false
启动不报错了,但是无法访问
3.最后
把访问地址中的eureka去掉
http://127.0.0.1:8086
既然正常访问,无解