Reputation: 3736
I use spring boot 2.0.X and want to use an admin-server that automatically detects other services registered at Eureka. I have followed this guide to the letter, but none of the applications are shown in the admin console. All applications are registered with Eureka successfully.
Admin-server configuration:
server:
port: 8762
spring:
application:
name: admin-server
boot:
admin:
discovery:
ignored-services: admin-server
#The admin server will automatically pick up all services at eureka and register them to itself.
eureka:
instance:
leaseRenewalIntervalInSeconds: 10
health-check-url-path: /actuator/health
metadata-map:
startup: ${random.int} #needed to trigger info and endpoint update after restart
client:
registryFetchIntervalSeconds: 5
registerWithEureka: true #default true
fetchRegistry: true #default true
serviceUrl:
defaultZone: http://localhost:8761/eureka/
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
Eureka server configuration:
server:
port: 8761
spring:
application:
name: discovery-server
eureka:
instance:
hostname: localhost
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://localhost:8761/eureka/
Some thoughts:
The application.yml that all other applications get from the config server contains the following:
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
spring:
boot:
admin:
url: http://localhost:8762
management: #exposing all endpoints is not safe for production, especially not if spring security gets involved
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
Upvotes: 0
Views: 2415
Reputation: 133
I had the same issue when upgrading to SBA2.
Versions of spring-boot, spring-cloud and SBA should match. I used:
spring-boot: 2.0.7.RELEASE
spring-cloud: Finchley.SR2
SBA: 2.0.4
In my case the trick was to use spring-boot-admin-starter-server as dependency instead of plain dependencies (spring-boot-admin-server, spring-boot-admin-server-ui, spring-boot-admin-server-cloud) as it is descriped here: https://github.com/codecentric/spring-boot-admin/issues/776
Upvotes: 2