APM scouter-server 및 scouter-paper 설치
APM scouter-server 및 scouter-paper 설치
APM (Application Performance Management)
jennifer(제니퍼), SysMaster(시스마스터), InterMax(인터맥스), Elastic APM 등 유명한 상용 APM도 존재하고
Scouter(스카우터), Pinpoint 등 무료 APM이 존재한다.
오픈소스 APM 소프트웨어인 scouter의 scouter-server 및 scouter-paper 설치하여 톰캣을 모니터링 해보기로 하였다.
요청한 아이피, 요처시간, DB 쿼리등 was의 전반적인 로그 등을 확인 할 수있고 부하가 있을때 서버 튜닝을 위해 확인하는
용도로도 적합하다.
https://github.com/scouter-project/scouter
https://scouter-contrib.github.io/scouter-paper/manual.html
GitHub - scouter-project/scouter: Scouter is an open source APM (Application Performance Management) tool.
Scouter is an open source APM (Application Performance Management) tool. - GitHub - scouter-project/scouter: Scouter is an open source APM (Application Performance Management) tool.
github.com
Paper
레이아웃 관리 PAPER와 METRIC이 결합된 정보와 PAPER의 크기와 위치 정보 전체 레이아웃이라고 정의합니다. 이러한 레이아웃 정보를 우측 상단의 LAYOUT 버튼을 클릭하여, 관리할 수 있습니다. 기본적
scouter-contrib.github.io
[아키텍처]
Modules | 설 명 |
Server(Collector) | Agent가 전송한 데이터 수집/처리 |
Host Agent | OS의 CPU, Memory, Disk등의 성능 정보 전송 |
Java Agent | 실시간 서비스 성능 정보, Heap Memory, Thread 등 Java 성능 정보 |
Client(Viewer) | 수집된 성능 정보를 확인하기 위한 Client 프로그램 |
[docker-compose.yml]
version: '3.2'
services:
scouter-paper:
image : scouterapm/scouter-paper:2.6.4
restart : always
ports:
- 8282:80
scouter:
image : scouterapm/scouter-server:2.10.2
restart : always
environment:
- SC_SERVER_ID=SCCOUTER-COLLECTOR
- NET_HTTP_SERVER_ENABLED=true
- NET_HTTP_API_SWAGGER_ENABLED=true
- NET_HTTP_API_ENABLED=true
- MGR_PURGE_PROFILE_KEEP_DAYS=2
- MGR_PURGE_XLOG_KEEP_DAYS=5
- MGR_PURGE_COUNTER_KEEP_DAYS=15
- JAVA_OPT=-Xms1024m -Xmx1024m
volumes:
- ./logs:/home/scouter-server/logs
- ./sc-data:/home/scouter-server/database
ports:
- 6188:6180
- 6100:6100
- 6100:6100/udp
[실행]
$ sudo docker-compose up -d
Creating network "scouter_default" with the default driver
Pulling scouter-paper (scouterapm/scouter-paper:2.6.4)...
2.6.4: Pulling from scouterapm/scouter-paper
e7c96db7181b: Already exists
f0e40e45c95e: Pull complete
cb818971fab6: Pull complete
5ac43978c756: Pull complete
3ef094174723: Pull complete
b200969d75cd: Pull complete
Digest: sha256:13edd16e7c17c1eaf67d084af35aa9e6cc7b0ba2e70b43190ec555c941ac24e4
Status: Downloaded newer image for scouterapm/scouter-paper:2.6.4
Pulling scouter (scouterapm/scouter-server:2.10.2)...
2.10.2: Pulling from scouterapm/scouter-server
e7c96db7181b: Already exists
f910a506b6cb: Already exists
c2274a1a0e27: Already exists
d64ce61351d7: Pull complete
9a0ef7fa06c0: Pull complete
beb9f499ce80: Pull complete
70dbd8c941fd: Pull complete
Digest: sha256:a2b3df0ae04929d7d08748b05a8f562854b350be8cda2e72d681287478232316
Status: Downloaded newer image for scouterapm/scouter-server:2.10.2
Creating scouter_scouter-paper_1 ... done
[scouter-paper]
http://localhost:8282
[scouter-server]
http://localhost:6188/scouter/v1/info/server
{"status":"200","requestId":"#mbu9","resultCode":"0","message":"success","result":[{"id":"-1082951330","name":"SCCOUTER-COLLECTOR","connected":true,"serverTime":"1680740477280","version":"2.10.2 2020-12-19 01:45 GMT"}]}
[agent 설치]
모니터링할 톰캣이 있는 was 서버에 agent 파일 설치
https://github.com/scouter-project/scouter/releases/tag/v2.17.1
Release v2.17.1 · scouter-project/scouter
Important execute the command to run scouter client for Mac(OSX) xattr -cr scouter.client.app scouter client for Mac needs Java11+ On issue to display xlog list table, remove the directory ~/.scou...
github.com
암축을 풀면 6개을 폴더가 있다.
서버는 이미 docker로 설치를 하였기 때문에 was에 agent.java의 설정을 수정해서 was서버에 복사해준다.
agent.batch
agent.host
agent.java
agent.java_6_7
server
webapp
[./agent.host/conf/scouter.conf]
### scouter host configruation sample
#net_collector_ip=127.0.0.1 scouter-server ip
#net_collector_udp_port=6100 scouter-server collector port
#net_collector_tcp_port=6100
#cpu_warning_pct=80
#cpu_fatal_pct=85
#cpu_check_period_ms=60000
#cpu_fatal_history=3
#cpu_alert_interval_ms=300000
#disk_warning_pct=88
#disk_fatal_pct=92
### scouter host configruation sample
net_collector_ip=192.168.0.10
net_collector_udp_port=6100
#net_collector_tcp_port=6100
#cpu_warning_pct=80
#cpu_fatal_pct=85
#cpu_check_period_ms=60000
#cpu_fatal_history=3
#cpu_alert_interval_ms=300000
#disk_warning_pct=88
#disk_fatal_pct=92
### Scouter Paper
counter_interaction_enabled=true
[agent 실행]
.\host.bat
C:\dev\docker\scouter\scouter-all-2.17.1\scouter\agent.host>java -classpath ./scouter.host.jar scouter.boot.Boot ./lib
____
/ ___| ___ ___ _ _| |_ ___ _ __
\___ \ / __/ \| | | | __/ _ \ '__|
___) | (_| (+) | |_| | || __/ |
|____/ \___\___/ \__,_|\__\___|_|
Open Source S/W Performance Monitoring
Scouter version 2.17.1
Configure -Dscouter.config=.\conf\scouter.conf
Scouter Host Agent Version 2.17.1 2022-03-27 04:35 GMT
System JRE version : 1.8.0_332
[Java Agent]
JAVA_OPTS=" ${JAVA_OPTS} -javaagent:${SCOUTER_AGENT_DIR}/scouter.agent.jar"
JAVA_OPTS=" ${JAVA_OPTS} -Dscouter.config=${SCOUTER_AGENT_DIR}/scouter.conf
서버에서 구동시
Tomcat 설정파일 (setenv.sh)
JAVA_OPTS=" ${JAVA_OPTS} -javaagent:/home/user/../scouter.agent.jar"
JAVA_OPTS=" ${JAVA_OPTS} -Dscouter.config=/home/user/../scouter.conf
이클립스에서 구동시
-javaagent:C:/dev/docker/scouter/scouter-all-2.17.1/scouter/agent.java/scouter.agent.jar
-Dscouter.config=C:/dev/docker/scouter/scouter-all-2.17.1/scouter/agent.java/conf/scouter.conf
-Dobj_name=was01
[scouter-paper 확인]
agent.host(시스템)와 agent.java(tomcat)가 연동된 것을 확인 할 수 있다
[가이드]
https://scouter-contrib.github.io/scouter-paper/manual.html
Paper
레이아웃 관리 PAPER와 METRIC이 결합된 정보와 PAPER의 크기와 위치 정보 전체 레이아웃이라고 정의합니다. 이러한 레이아웃 정보를 우측 상단의 LAYOUT 버튼을 클릭하여, 관리할 수 있습니다. 기본적
scouter-contrib.github.io
[실행형 클라이언트]
윈도우, 리눅스, 맥에서 실행하는 클라이언트도 제공한다.
scouter-pape 보다 더욱 상세한 정보를 확인 할 수 있다.