스프링 부트 개념과 활용
5. 스프링 부트 운영
스프링 부트는 애플리케이션 운영 환경에서 유용한 기능을 제공합니다
스프링 부트가 제공하는 엔드포인트와 메트릭스 그리고 그 데이터를 활용하는 모니터링 기능에 대해 학습합니다
포스팅 참조 정보
GitHub
공부한 내용은 GitHub에 공부용 Organizations에 정리 하고 있습니다
해당 포스팅에 대한 내용의 GitHub 주소
실습 내용이나 자세한 소스코드는 GitHub에 있습니다
포스팅 내용은 간략하게 추린 핵심 내용만 포스팅되어 있습니다
https://github.com/freespringlecture/springboot-concept-uses/tree/chap05-02-actuator_jmx_http
freespringlecture/springboot-concept-uses
백기선님의 스프링 부트 개념과 활용 강의 내용 정리. Contribute to freespringlecture/springboot-concept-uses development by creating an account on GitHub.
github.com
해당 포스팅 참고 인프런 강의
https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8/dashboard
스프링 부트 개념과 활용 - 인프런
스프링 부트의 원리 및 여러 기능을 코딩을 통해 쉽게 이해하고 보다 적극적으로 사용할 수 있는 방법을 학습합니다. 중급 프레임워크 및 라이브러리 Spring Spring Boot 온라인 강의
www.inflearn.com
실습 환경
- Java Version: Java 11
- SpringBoot Version: 2.1.2.RELEASE
2. 스프링 부트 Actuator 2부: JMX와 HTTP
JConsole 사용하기
https://docs.oracle.com/javase/tutorial/jmx/mbeans/
Lesson: Introducing MBeans (The Java™ Tutorials > Java Management Extensions (JMX))
The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available. See JDK Release Notes for information about new fe
docs.oracle.com
https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html
Using JConsole - Java SE Monitoring and Management Guide
Chapter 3 Using JConsole The JConsole graphical user interface is a monitoring tool that complies to the Java Management Extensions (JMX) specification. JConsole uses the extensive instrumentation of the Java Virtual Machine (Java VM) to provide informatio
docs.oracle.com
- console에서 jconsole 입력
- Local Process에서 내가 구동한 Application을 선택하고 connect
- SSL로 접속을 시도하다가 SSL을 적용 안했으므로 Insecure connection을 클릭
- 접속하면 Overview에서 Heap Memory Usage, Threads(Thread 개수), Classes(로딩한 Class개수), CPU Usage를 보여줌
- 그 외 각각의 정보를 상세히 볼 수 있는 Tab을 제공
VisualVM 사용하기
https://visualvm.github.io/download.html
VisualVM: Download
First Steps Unzip the downloaded archive. The archive already contains the top-level visualvm directory. Start VisualVM by invoking the binary appropriate for your OS:visualvm\bin\visualvm.exe or visualvm/bin/visualvm You may provide additional options to
visualvm.github.io
- 기존에는 jvisualvm이 java에서 제공을 했었는데 java10 부터 제공되지 않아서 별도로 설치해야됨
- Visual 로 jconsole 보다 훨씬 보기 좋은 UI를 제공함
mbean 플러그인 추가하기
Tools - Plugins - Available Plugins - VisualVM-Mbeans 설치
HTTP 사용하기
health와 info를 제외한 대부분의 Endpoint가 기본적으로 비공개 상태
/actuator
공개 옵션 조정
이런 정보들이 밖으로 노출되면 매우 위험하므로
SpringSecurity
를 적용해서Endpoints
를Admin
만 접근이 가능하도록 해야함
모든 EndPoints 모두공개 설정
management.endpoints.web.exposure.include=*
일부 EndPoints 비공개 설정
management.endpoints.web.exposure.exclude=env,beans
'개발강의정리 > Spring' 카테고리의 다른 글
[스프링 데이터 JPA] 4-1. 스프링 데이터 JPA: JPA Repository (0) | 2019.12.14 |
---|---|
[스프링 부트 개념과 활용] 5-3. 스프링 부트 Actuator 3부: 스프링 부트 어드민 (0) | 2019.12.05 |
[스프링 부트 개념과 활용] 5-1. 스프링 부트 Actuator 1부: 소개 (0) | 2019.12.03 |
[스프링 부트 개념과 활용] 4-13. 그 밖에 다양한 기술 연동 (0) | 2019.12.02 |
[스프링 부트 개념과 활용] 4-12. 스프링 REST 클라이언트 2부: 커스터마이징 (0) | 2019.12.01 |
댓글