Я пытаюсь запустить Eureka Server и Spring Boot Admin Server в одном приложении (SBA Docu говорит, что это возможно). Eureka работает как положено, но приложение Admin по-прежнему показывает ноль приложений.
Spring Boot версии 2.0.3,
Spring Boot Admin версия 2.0.1
Eureka и SBA Server
@SpringBootApplication
@EnableEurekaServer
@EnableDiscoveryClient
@EnableAdminServer
class KotlintestApplication
fun main(args: Array<String>) {
SpringApplication.run(KotlintestApplication::class.java, *args)
}
Сервер bootstrap.yml
spring:
application:
name: server
Серверное приложение.yml
spring:
boot:
admin:
context-path: /admin
eureka:
instance:
leaseRenewalIntervalInSeconds: 10
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://localhost:8080/eureka
Клиент
@EnableDiscoveryClient
@SpringBootApplication
class KotlintestApplication
fun main(args: Array<String>) {
SpringApplication.run(KotlintestApplication::class.java, *args)
}
@Configuration
class SecurityPermitAllConfig : WebSecurityConfigurerAdapter() {
@Throws(Exception::class)
override fun configure(http: HttpSecurity) {
http.authorizeRequests().anyRequest().permitAll()
.and().csrf().disable()
}
}
Клиент bootstrap.yml
spring:
application:
name: client
server:
port: 0
Клиентское приложение.yml
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
eureka:
instance:
hostname: localhost
health-check-url-path: /actuator/health
status-page-url-path: /actuator/info
client:
serviceUrl:
defaultZone: http://127.0.0.1:8080/eureka/