Scene:
When starting Eureka server, the following error occurred:
Com.sun.jersey.api.client.ClientHandlerException:java.net.ConnectException:Connection refused: Connectcom.netflix.discovery.shared.transport.TransportException:Cannot execute request on any known server
Problem solving:
View Profile application.yml, find the Register-with-eureka property value set to True, change it to false, restart the Eureka service, start successfully, solve the problem
Reason:
Under the default settings, the Eureka Service registry will also attempt to register itself as a client, so we need to disable its client registration behavior:
Eureka: instance: hostname:localhost client: Registerfalse fetch false
Summarize:
If the client registration behavior of the Eureka Service registry is not disabled, a Service-url registry address is required:
Server: 8091Eureka: instance: hostname:localhost client: Registertrue Fetch false #注册中心地址 service-URL: defaultzone:http://${ eureka.instance.hostname}:${server.port}/eureka/
Springcloud Problem Resolution: Spring-cloud-eureka startup error cannot execute request on any known server