Spring Boot Admin Server No applications registered

450 Views Asked by At

I am trying to use the Spring admin server via the following code and properties.

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import de.codecentric.boot.admin.server.config.EnableAdminServer;

@SpringBootApplication
@EnableAdminServer
public class MainApplication {
    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
    }
}

Maven:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server</artifactId>
    <version>3.1.1</version>
</dependency>
<dependency>
    <groupId>de.codecentric</groupId>
    <artifactId>spring-boot-admin-server-ui</artifactId>
    <version>3.1.1</version>
</dependency>

properties:

server.port=8083
management.security.enabled = false
spring.application.name = adminserver

But when i try to access the web page on http://localhost:8083/applications i get the following

No applications registered
1

There are 1 best solutions below

0
Stephan Köninger On BEST ANSWER

The purpose of Spring Boot Admin is to monitor Spring Boot Clients. You are just setting up a Server without having a client registered to it.

There are several ways to register a Spring Boot application as client to Sprint Boot Admin server. The easiest way is a static configuration. Add the following dependency to your Spring Boot web application and configure the Spring Boot Admin Client to point to your running Spring Boot Admin instance at http://localhost:8083.

    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-starter-client</artifactId>
    </dependency>

Add this to your application.yaml:

spring:
  boot:
    admin:
      client:
        url: http://localhost:8083

Please also consult our documentation for registering clients at https://docs.spring-boot-admin.com/current/getting-started.html#register-client-applications.