com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

后端 未结 10 1659
眼角桃花
眼角桃花 2020-12-30 19:32

I am very new to the microservices and trying to run the code from link: https://dzone.com/articles/advanced-microservices-security-with-spring-and-oa . When I simply run th

10条回答
  •  一向
    一向 (楼主)
    2020-12-30 20:33

    This is happening because it is trying to connect to any known server, so to stop that error, a known server is eureka server on port 8761 which is its default port, you will have to update the application.properties with following

    server.port=8761
    

    To avoid eureka from registering itself, you add this to the application.properties

    eureka.client.register-with-eureka=false
    

    Ensure that EurekaServer is enabled, for example using spring boot you write the below on the main class.

    @EnableEurekaServer
    

    Please pardon me providing solution using .properties file but that is what i work with but .yml configurations shouldn't be too different.

提交回复
热议问题