동현 유
척척석사
동현 유
전체 방문자
오늘
어제
  • 분류 전체보기 (181)
    • BlockChain (48)
      • [paper] Consensus (13)
      • [paper] Execution (19)
      • [paper] Storage (5)
      • [paper] ZKP (1)
      • [paper] Oracle (1)
      • Blockchains (9)
    • Java (19)
      • Java의 정석 (13)
      • Java 파헤치기 (5)
    • Python (20)
      • Python 뜯어보기 (6)
      • 데이터 분석 기초 (5)
      • Python 기초 강의 (6)
      • Python 기초 강의 부록 (3)
    • Golang (0)
    • MySQL (3)
      • programmers (2)
      • 기본 문법 (0)
    • 웹 프로젝트 (IBAS) (36)
      • Django 레거시 (14)
      • SpringBoot api 개편 (14)
      • Infra (3)
      • 서버 장애 기록 (4)
      • 신입팀원 교육 자료 (1)
    • CS (30)
      • Operating System (22)
      • Computer Security (3)
      • Network (4)
      • DBMS (1)
    • 책 (10)
      • 도메인 주도 설계 철저 입문 (9)
      • Real MySQL 8.0 (1)
    • BOJ 문제 풀이 (3)
    • 이러쿵저러쿵 (10)
    • 회고 (1)

인기 글

최근 댓글

최근 글

hELLO · Designed By 정상우.
동현 유

척척석사

Spring MSA 를 간단하게 구현해보자 (+ 최신 release, 모니터링, heapdump)
Java/Java 파헤치기

Spring MSA 를 간단하게 구현해보자 (+ 최신 release, 모니터링, heapdump)

2022. 5. 5. 02:37

 

 

GitHub - Dong-Hyeon-Yu/spring-cloud-monitoring-example: Monitoring Spring MSA example (release train-2021.01) / gateway+discover

Monitoring Spring MSA example (release train-2021.01) / gateway+discovery+config+feign / grafana+prometheus+docker / jvm heap dump example - GitHub - Dong-Hyeon-Yu/spring-cloud-monitoring-example:...

github.com


 

환경

▪️ Release Trains : 2021.0.1 (https://spring.io/projects/spring-cloud)

▪️ Java : openjdk-11

▪️ Spring Boot : 2.6.6

▪️ Gradle : 7.4

▪️ OS : linux 20.04.4 LTS

▪️ IDE : IntelliJ IDEA Ultimate Edition


▪️ Test EndPoint

: localhost:8080/api/member (gateway) -> (resoure-service)


Spring Cloud 구성요소

  • spring-cloud-eureka-server
  • spring-cloud-gateway
  • spring-cloud-config
  • spring-cloud-openfeign
  • springdoc-openapi-ui:1.6.0

모니터링 툴 

  • prometheus :9090 포트로 접속
  • grafana : 3000 포트로 접속
  • docker-compose

실행 주의사항

: spring-cloud-config 를 먼저 실행시켜야, 나머지 JVM 인스턴스가 떴을때 설정파일을 받을 수 있음
(you must execute 'spring-cloud-config' first so that the other services get it's own application.yml files)

: 모니터링을 위해서는 docker-compose 를 이용해서 컨테이너를 띄워야함. (.monitor 폴더에 위치)
(you should do docker-compose up for monitoring under '.monitor' folder)


모니터링 예시 

 [jvm(Micrometer)]

스크린샷, 2022-04-04 21-14-11

 [node_exporter] 

스크린샷, 2022-04-04 21-14-24


[jvm 힙 덤프 분석해보기]

: 아래 명령어로 덤프파일 생성 후, Eclipse Memory Analyzer(MAT) 로 열어서 확인
(After creating a dumpfile using command lines below, open the file with 'Eclipse Memory Analyzer')

~$ jps  # jvm 프로세스 id를 알아내는 명령어 (finding all jvm pid)
85887 config service 
84762 discovery service
...(생략)...

~$ jmap -dump:format=b,file=heapdump.hprof 85887  # heapdump 파일 생성 명령어 (create heapdump files)

스크린샷, 2022-04-24 20-19-46

'Java > Java 파헤치기' 카테고리의 다른 글

Java 한글 인코딩 안될때 jdk 버전 확인해야함.  (1) 2022.05.06
JavaThread 에 대해 깊게 이해해보자 (feat. Openjdk 커널 분석)  (2) 2022.04.30
[JVM] 레퍼런스  (0) 2022.04.24
JIT compiler  (0) 2022.04.10
    동현 유
    동현 유
    Fault Tolerant System Researcher for more Trustful World and Better Lives. (LinkedIn: https://www.linkedin.com/in/donghyeon-ryu-526b8a276/)

    티스토리툴바