我已经创建了一个配置服务器并启用了发现客户端但我的问题出现在我的eureka服务器GUI上,它没有显示在应用程序选项卡下。
我的代码是:
@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
Application.yml
server:
port: 8761
eureka:
instance:
hostname: discovery
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://discovery:${server.port}/eureka/
spring.cloud.config.discovery.enabled: true
将服务器配置为eureka客户端
@Configuration
@EnableAutoConfiguration
@EnableDiscoveryClient
@EnableConfigServer
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Application.yml
server:
port: 8888
eureka:
instance:
hostname: configserver
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://discovery:8761/eureka/
spring:
cloud:
config:
server:
git:
uri: https://github.com/kbastani/spring-boot-microservice-config
首先运行Eureka服务器,然后运行配置服务器,所有工作正常并且没有异常但在Instance选项卡下没有列出应用程序,请找到下面的屏幕截图:
有人可以帮助我理解这个吗?