일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- SpringBoot
- mybatis
- MariaDB
- PM2
- Push
- security
- Eclipse
- rocky9
- git
- node.js
- nodejs
- jenkins
- yona
- config
- docker
- spring3
- Java
- NextJS
- mysql
- Tomcat
- ajax
- Maven
- Next.js
- popup
- centos7
- MSsql
- pwa
- jquery
- FCM
- javascript
- Today
- Total
ふたりで
tomcat 모니터링을 위한 scouter 설치 설정. 본문
나 자신이 보기 위해 정리하는 내용 이기 때문에 다소 부족한 내용이 있을 수 있음.
1. 서버환경.
- VirtualBox7.0
- centos7.9 x64
- java 8
- tomcat8.5
2. 클라이언트 환경.
- windows11 home
- java 11
3. scouter 서버 프로그램 설치 설정.
먼저 scouter GIT 사이트에 접속해 서버용 설치 파일을 다운로드하고 압축을 해제한다.
]# pwd
/home/graykang
]# wget https://github.com/scouter-project/scouter/releases/download/v2.20.0/scouter-all-2.20.0.tar.gz
]# tar xvfz scouter-all-2.20.0.tar.gz
]# cd ./scouter
]# ll
합계 4
drwxr-xr-x. 3 root root 155 2월 3 17:37 agent.batch
drwxr-xr-x. 5 root root 270 2월 4 10:44 agent.host
drwxr-xr-x. 5 root root 106 2월 4 11:08 agent.java
drwxr-xr-x. 8 root root 4096 2월 4 10:27 server
drwxr-xr-x. 5 root root 207 2월 3 17:37 webapp
]#
압축이 풀린 경로는 /home/graykang/scouter/이다.
보면 크게 server와 agent.host 그리고 agent.java 3가지에 대해 설정이 필요하며, server 설정의 경우 기본포트 6100으로
구동을 한 이후 클라이언트로 6100으로 접속 후 server에 대한 나머지 설정을 하면 된다.
4. 서버 구동.
/home/graykang/scouter/server/폴더 내에 있는 startup.sh 파일을 실행하여 서버를 구동시킨다.
]# ./startup.sh
nohup: redirecting stderr to stdout
]#
server가 잘 올라왔는지 아래 왕같이 확인해 볼 수 있다.
]# tail -f -n100 ./nohup.out
tail: ./nohup.out: 파일이 잘렸음
____ _
/ ___| ___ ___ _ _| |_ ___ _ __
\___ \ / __/ \| | | | __/ _ \ '__|
___) | (_| (+) | |_| | || __/ |
|____/ \___\___/ \__,_|\__\___|_|
Open Source S/W Performance Monitoring
Scouter version 2.20.0
System JRE version : 1.8.0_392
]#
5. 클라이 언트로 접속해 보기.
먼저 클라이언트로 접속을 해보려면 6100번 포트에 대해 방화벽을 오픈해줘야 한다.
tcp/udp 모두 오픈을 해주자.
]# firewall-cmd --zone=public --permanent --add-port=6100/tcp
]# firewall-cmd --zone=public --permanent --add-port=6100/udp
]# firewall-cmd --reload
success
]#
6. windows 11 이 설치된 클라이언트 PC에 scouter.client 프로그램을 다운로드 및 실행한다.
https://github.com/scouter-project/scouter/releases/
Releases · scouter-project/scouter
Scouter is an open source APM (Application Performance Management) tool. - scouter-project/scouter
github.com
위 url에 접속하여 scouter.client.product-win32.win32.x86_64.zip를 선택해 다운로드 후 압축을 풀면 아래와 같이 파일이 생성된다.
/다운로드/scouter.client
# scouter클라이언트는 java11을 설정해 줘야 정상 구동된다. java11 이상에서만 구동 가능 하다.
설정 방법은 java11을 다운로드하여 java11이 위치한 경로를 scouter.ini 파일에 설정해 주면 된다.
- scouter.ini 내용.
-startup
plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650
-data
@user.home/scouter
#jvm set
-vm
C:\_DevelopTool\jdk11.0.26_4\bin\javaw.exe
-vmargs
-Xms128m
-Xmx1024m
-XX:+UseG1GC
-Dosgi.requiredJavaVersion=11
-vm부분에 C:\_DevelopTool\jdk11.0.26_4\bin\javaw.exe을 추가해 줬다.
# 이제 클라이언트를 실행하여 scouter서버에 접속해 보자.
서버 ip와 port를 입력하고 ID은 admin password도 admin을 입력하면 아래와 같이 클라이 언트 화면으로 전환된다.
# 관리계정과 접속 포트 등의 변경 방법은 별도로 찾아봐야 할 것 같다.
7. agent.host 서비스 설정 및 구동.
agent.host를 설정 및 구동시키면 클라이언트에 host서버의 부하량을 확인할 수 있다.
아래 내용을 참고하여 host설정을 하고 구동시켜 보자.
//agent.host설정.
]# pwd
/home/graykang/scouter/agent.host/conf
]# ll
합계 4
-rw-r--r--. 1 root root 278 2월 4 10:03 scouter.conf
]# cat scouter.conf
### scouter host configruation sample
net_collector_ip=127.0.0.1
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
//agent.host 서비스 구동
]# pwd
/home/graykang/scouter/agent.host
]# ./host.sh
nohup: redirecting stderr to stdout
]#
net_collector_ip는 scouter서버를 구동한 서버의 ip를 입력하면 된다.
위와 같이 구동후 클라이언트에서 다시 접속하면 아래와 같이 host가 추가된 것을 확인할 수 있다.
8. agent.java 서비스 설정 및 구동.
tomcat을 모니터링하기 위해 꼭 설정해줘야 한다. 설정 방법은 agent.host 설정 방법과 동일 하지만
따로 서비스 구동을 하지 않아도 된다. 대신 tomcat의 catalina.sh에 연동 관련 추가 옵션 스크립트를
추가해야 한다.
먼저 아래 내요을 참고하여 agent.java를 설정하자.
]# pwd
/home/dbkang/scouter/agent.java/conf
]# ll
합계 8
-rw-r--r--. 1 root root 634 2월 4 10:45 scouter.conf
-rw-r--r--. 1 root root 26 10월 1 2021 testcase-scouter.conf
]# cat ./scouter.conf
### scouter java agent configuration sample
obj_name=WAS-01
net_collector_ip=127.0.0.1
net_collector_udp_port=6100
net_collector_tcp_port=6100
#hook_method_patterns=sample.mybiz.*Biz.*,sample.service.*Service.*
#trace_http_client_ip_header_key=X-Forwarded-For
#profile_spring_controller_method_parameter_enabled=false
#hook_exception_class_patterns=my.exception.TypedException
#profile_fullstack_hooked_exception_enabled=true
#hook_exception_handler_method_patterns=my.AbstractAPIController.fallbackHandler,my.ApiExceptionLoggingFilter.handleNotFoundErrorResponse
#hook_exception_hanlder_exclude_class_patterns=exception.BizException
]#
다음으로 tomcat의 catalina.sh에 아래 내요을 참고하여 스크립트를 설정하자.
]# pwd
/usr/local/tomcat8/bin
]# cat catalina.sh
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
.
.
.
# scouter setting by graykang
SCOUTER_AGENT_DIR="/home/graykang/scouter/agent.java"
export JAVA_OPTS=" ${JAVA_OPTS} -javaagent:${SCOUTER_AGENT_DIR}/scouter.agent.jar"
export JAVA_OPTS=" ${JAVA_OPTS} -Dscouter.config=${SCOUTER_AGENT_DIR}/conf/scouter.conf"
# ----- Execute The Requested Command -----------------------------------------
# Bugzilla 37848: only output this if we have a TTY
if [ $have_tty -eq 1 ]; then
echo "Using CATALINA_BASE: $CATALINA_BASE"
.
.
.
[root@vm-centos7_56_1 bin]#
Execute the Requested Command 부분의 위쪽에 # scouter setting by graykang라고 된 부분이 설정한 부분이다.
이제 tomcat서비스를 재시작하고 scouter클라이언트로 접속을 해보면 아래와 같이 was-01라고 표시가 된다.
출처:
https://github.com/scouter-project/scouter
GitHub - scouter-project/scouter: Scouter is an open source APM (Application Performance Management) tool.
Scouter is an open source APM (Application Performance Management) tool. - scouter-project/scouter
github.com
'Other' 카테고리의 다른 글
rocky9linux + nginx + tomcat or nodejs 연동 시 error log "Permission denied" 발생 시 참고. (0) | 2024.12.12 |
---|---|
MSSQL SELECT 결과로 DELETE 하기. (0) | 2024.07.26 |
windows11 특정 port를 사용중인 프로그램 찾기 (0) | 2024.05.21 |
yona GIT 활용 참고. (0) | 2024.01.30 |
SQL 테이블내 데이터의 합으로 일괄 업데이트 (0) | 2024.01.10 |