Spring Boot Admin

JaeGu Jeong·2024년 2월 20일

사용 목적

아직 제대로 사용하지 못했지만 곧 힙 덤프와 스레드 덤프 디버깅에 사용할 예정으로 준비해 뒀다.
디버깅에 사용 하고 내용도 추가 예정이다.

의존성 설치

spring-boot-admin-starter의 서버와 클라이언트를 본인의 프레임워크 버전에 맞춰서 설치한다.
현재 빌드 환경은 스프링부트 2.7.12

		<!-- https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server -->
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-server</artifactId>
			<version>2.7.12</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-client -->
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-client</artifactId>
			<version>2.7.12</version>
		</dependency>

프로퍼티 파일 설정

관리 할 서버의 엔드포인트 설정을 한다.
본인은 prepix로 "/api"로 사용중이기 때문에 필요에 따라 해당부분을 모두 "/"로 바꿔도 된다.

server.servlet.context-path=/api
server.port=8080
spring.boot.admin.client.instance.service-url=http://localhost:8080/api
spring.boot.admin.client.url=http://localhost:8080/api
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
management.endpoints.web.base-path=/api/actuator

관리자 서버 활성화

"@EnableAdminServer"어노테이션을 "@SpringBootApplication" 아래에 추가해서 서버를 활성화한다.

@SpringBootApplication
@EnableAdminServer
public class KiwiApplication {

	public static void main(String[] args) {
		SpringApplication.run(KiwiApplication.class, args);
	}

}
profile
BackEnd Developer

0개의 댓글