新增自动发现服务
建立一个 eureka-server 专案
使用到的组件如下
Cloud Config Cloud Discovery
Config Client Eureka Server
新增 bootstrap.properties 然后把不需要的 application.properties 删除,因为组态档我们使用 Config Server 提供的
bootstrap.properties
新增 eureka-service.properties 到 Config-Server 设定档路径底下
eureka-service.properties
其实 hostname 理论上是可以不用加的,但是会出现以下的错误讯息,不过网路上是说这没关系是没有Client的错误
log
主要程序部分
EurekaServerApplication.java
启动后就可以从 http://localhost:8761/ 观察到目前有哪些服务。
原创文章,作者:自考吧,如若转载,请注明出处:https://www.zk021.com/10977.hrml