Skip to content
정명주(myeongju.jung) edited this page May 13, 2019 · 4 revisions

현재 스카우터 버전 1.7.3.1 기준으로 작성되었습니다.

설치

JDK 1.8 설치

$ mkdir -p ~/pkgs
$ mkdir -p ~/apps
$ cd ~/pkgs
$ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-linux-x64.tar.gz 
$ mv jdk-8u152-linux-x64.tar.gz ~/apps/

$ cd ~/apps
$ tar -xvf jdk-8u152-linux-x64.tar.gz
$ ln -s jdk1.8.0_152 java
$ rm -rf jdk-8u152-linux-x64.tar.gz

vi ~/.bash_profile

JAVA_HOME=$HOME/apps/java

PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:

export JAVA_HOME
export PATH
$ source ~/.bash_profile

$ cd ~
$ java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

Scouter collecter 설치

$ cd ~/pkgs 
$ wget https://github.com/scouter-project/scouter/releases/download/v1.7.3.1/scouter-all-1.7.3.1.tar.gz
$ cp scouter-all-1.7.3.1.tar.gz ~/apps

$ cd ~/apps
$ tar -xvf scouter-all-1.7.3.1.tar.gz
$ rm -rf scouter-all-1.7.3.1.tar.gz

Scouter Collector Startup & Shutdown

Scouter Collector Startup

$ cd ~/apps/scouter/server
$ ./startup.sh
nohup: redirecting stderr to stdout
____ _
/ ___| ___ ___ _ _| |_ ___ _ __
\___ \ / __/ \| | | | __/ _ \ '__|
___) | (_| (+) | |_| | || __/ |
|____/ \___\___/ \__,_|\__\___|_|
Open Source S/W Performance Monitoring
Scouter version 1.7.3.1
System JRE version : 1.8.0_152
$ ps -ef | grep scouter
irteam 15977 1 10 20:10 pts/0 00:00:02 java -Xmx512m -classpath ./scouter-server-boot.jar scouter.boot.Boot ./lib

Scouter Collector Shutdown

$ cd ~/apps/scouter/server
$ ./stop.sh

Scouter Collector Confi

server_id=sample
net_tcp_listen_port=6100
net_udp_listen_port=6100
db_dir=/scouter-fs/sample/db
log_dir=/scouter-fs/sample/log
log_keep_days=7

mgr_purge_profile_keep_days=7
mgr_purge_xlog_keep_days=7
mgr_purge_counter_keep_days=7

# web-api
net_http_server_enabled=true
net_http_api_enabled=true
net_http_port=6180

Tomcat(Java) Monitoring

  • 모니터링할 톰켓이 실행되는 장비에 접근

Download java agent

$ mkdir -p ~/pkgs
$ mkdir -p ~/apps

$ cd ~/pkgs
$ wget https://github.com/scouter-project/scouter/releases/download/v1.7.3.1/scouter-all-1.7.3.1.tar.gz
$ cp scouter-all-1.7.3.1.tar.gz ~/apps/

$ cd ~/apps
$ tar -xvf scouter-all-1.7.3.1.tar.gz
$ rm -rf scouter-all-1.7.3.1.tar.gz

vi ~/.bash_profile

SCOUTER_AGENT_DIR=~/apps/scouter/agent.java
export SCOUTER_AGENT_DIR
$ source ~/.bash_profile

Configuration

주의사항

해당 문서는 sample 기반으로 설명하였으므로, 다른 환경에 적용 시 적절하게 응용해야함

vi $SCOUTER_AGENT_DIR/conf/sample.conf

# Scouter Server IP Address (Default : 127.0.0.1)
net_collector_ip=#SCOUTER_COLLECTOR_IP

# Scouter Server Port (Default : 6100)
net_collector_udp_port=6100
net_collector_tcp_port=6100

# Scouter Name(Default : tomcat1)
obj_name=sample-web # 적절하게 바꿔준다.

#hook_method_patterns=com.sample*.* # 적절하게 바꿔준다.
hook_method_patterns=com.domain*Controller.*,com.domain*Service.*,com.domain*Assembler.*,com.domain*Factory.*,com.domain*Aspect.*,com.domain*Subscriber.*,com.domain*Component.*,com.domain*ControllerAdvice.*, \
com.zaxxer.hikari.HikariDataSource.getConnection,com.zaxxer.hikari.pool.HikariPool.getConnection,com.zaxxer.hikari.pool.HikariProxyConnection.setReadOnly,com.zaxxer.hikari.pool.HikariProxyConnection.isReadOnly,com.zaxxer.hikari.pool.ProxyConnection.close

hook_exception_handler_method_patterns=com.domain*ControllerAdvice.*,com.domain*DefaultAsyncUncaughtExceptionHandler.*
hook_method_access_none_enabled=true

profile_http_parameter_enabled=true
profile_http_header_enabled=true
profile_fullstack_hooked_exception_enabled=true

vi ~/apps/tomcat/bin/setenv.sh

CATALINA_OPTS=" ${CATALINA_OPTS} -javaagent:${SCOUTER_AGENT_DIR}/scouter.agent.jar"
CATALINA_OPTS=" ${CATALINA_OPTS} -Dscouter.config=${SCOUTER_AGENT_DIR}/conf/alpha-admin-magazine.conf"

만약 스프링부트나 자바 데몬을 사용한다면 경우에 따라서 JAVA_OPTS 로 설정해야함 환경에 따라서 ${SCOUTER_AGENT_DIR} 환경변수가 안 먹힐 수도 있음. 그런 경우에는 직접 절대경로를 지정해야함

Host(장비) Monitoring

Configuration

vi ~/apps/scouter/agent.host/conf/scouter.conf

# Scouter Server IP Address (Default : 127.0.0.1)
net_collector_ip=#SCOUTER_COLLECTOR_IP

Startup

$ cd ~/apps/scouter/agent.host
$ ./host.sh
nohup: redirecting stderr to stdout
____ _
/ ___| ___ ___ _ _| |_ ___ _ __
\___ \ / __/ \| | | | __/ _ \ '__|
___) | (_| (+) | |_| | || __/ |
|____/ \___\___/ \__,_|\__\___|_|
Open Source S/W Performance Monitoring
Scouter version 1.7.3.1
Configure -Dscouter.config=./conf/scouter.conf
Scouter Host Agent Version 1.7.3.1 2017-08-21 11:58 GMT
System JRE version : 1.8.0_141

Shutdown

$ cd ~/apps/scouter/agent.host
$ ./stop.sh

Client

Reference

Clone this wiki locally