- [pinpoint 1.8.4] 설치 준비 - hbase 1.2.7 standalone - [pinpoint 1.8.4] 설치 준비 - tomcat 9.0.24 - [pinpoint 1.8.4] 설치 - web, collector, agent, ...
|
* hbase 스키마 생성
https://github.com/naver/pinpoint/releases/tag/1.8.4 의 Source Code 에서 hbase/scripts/hbase-create.hbase 파일 사용하여 스키마 생성.
hbase-create.hbase 엔 TTL 값이 31536000 초(365일), 5184000 초(60일) 로 데이터를 유지하도록 되어있어 604800 초(7일) 로 변경.
sed 's/31536000/604800/' hbase-create.hbase > hbase-create-my.hbase
sed -i 's/5184000/604800/' hbase-create-my.hbase
스키마 생성 실행
> /home/user1/pinpoint/hbase/bin/hbase shell /home/user1/pinpoint/files/pinpoint-1.8.4/hbase/scripts/hbase-create-my.hbase
2019-09-01 22:52:40,743 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
0 row(s) in 1.4510 seconds
0 row(s) in 2.2780 seconds
0 row(s) in 2.2920 seconds
0 row(s) in 1.2330 seconds
0 row(s) in 1.2470 seconds
0 row(s) in 1.2280 seconds
0 row(s) in 1.2480 seconds
0 row(s) in 1.2390 seconds
0 row(s) in 1.2290 seconds
0 row(s) in 4.2950 seconds
0 row(s) in 1.2470 seconds
0 row(s) in 1.2290 seconds
0 row(s) in 1.2310 seconds
0 row(s) in 1.2370 seconds
0 row(s) in 1.2340 seconds
TABLE
AgentEvent
AgentInfo
AgentLifeCycle
AgentStatV2
ApiMetaData
ApplicationIndex
ApplicationMapStatisticsCallee_Ver2
ApplicationMapStatisticsCaller_Ver2
ApplicationMapStatisticsSelf_Ver2
ApplicationStatAggre
ApplicationTraceIndex
HostApplicationMap_Ver2
SqlMetaData_Ver2
StringMetaData
TraceV2
15 row(s) in 0.0140 seconds
> echo $?
0
* pinpoint 다운로드
컴파일하지 않고 release 다운로드 : https://github.com/naver/pinpoint/releases
(컴파일하려면 여러 java 버전을 설치해야 한다고?.. )
# agent
> wget https://github.com/naver/pinpoint/releases/download/1.8.4/pinpoint-agent-1.8.4.tar.gz -P /home/user1/pinpoint/files
# collector
> wget https://github.com/naver/pinpoint/releases/download/1.8.4/pinpoint-collector-1.8.4.war -P /home/user1/pinpoint/files
# web
> wget https://github.com/naver/pinpoint/releases/download/1.8.4/pinpoint-web-1.8.4.war -P /home/user1/pinpoint/files
* pinpoint web 설치
> cd /home/user1/pinpoint/tomcat/webapps
# ROOT 백업. (불필요하면 삭제)
> mv ROOT ROOT.bk
> mkdir ROOT
> cd ROOT
# web war 복사 및 압축해제
> cp /home/user1/pinpoint/files/pinpoint-web-1.8.4.war ./
> jar xvf pinpoint-web-1.8.4.war
# hbase 주소 및 포트 수정(필요시)
# hbase.client.host=localhost
# hbase.client.port=2181
> vi /home/user1/pinpoint/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
# pinpoint web 설정 수정(필요시)
# config.sendUsage=false <----- disable google analytics
> vi /home/user1/pinpoint/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-web.properties
# tomcat 재시작
> tomcat/bin/shutdown.sh
> tomcat/bin/startup.sh
접속 확인 : http://192.168.56.101:8080
* pinpoint collector 설치
> cd /home/user1/pinpoint/tomcat/webapps
> mkdir pinpoint-collector-1.8.4
> cd pinpoint-collector-1.8.4
# web war 복사 및 압축해제
> cp /home/user1/pinpoint/files/pinpoint-collector-1.8.4.war ./
> jar xvf pinpoint-collector-1.8.4.war
> rm -rf pinpoint-collector-1.8.4.war
# 설정 디렉토리 이동
> cd WEB-INF/classes
# hbase 주소 및 포트 수정(필요시)
# hbase.client.host=localhost
# hbase.client.port=2181
> vi hbase.properties
# pinpoint web 설정 수정(필요시)
# collector.receiver.base.ip=0.0.0.0
# collector.receiver.base.port=9994
# collector.receiver.stat.udp.ip=0.0.0.0
# collector.receiver.stat.udp.port=9995
# collector.receiver.span.udp.ip=0.0.0.0
# collector.receiver.span.udp.port=9996
> vi pinpoint-collector.properties
# tomcat 재시작
> tomcat/bin/shutdown.sh
> tomcat/bin/startup.sh
listen port
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 9721/java
tcp6 0 0 :::8009 :::* LISTEN 9721/java
tcp6 0 0 :::9994 :::* LISTEN 9721/java
tcp6 0 0 192.168.56.101:9997 :::* LISTEN 9721/java
tcp6 0 0 :::8080 :::* LISTEN 9721/java
udp6 0 0 :::9995 :::* 9721/java
udp6 0 0 :::9996 :::* 9721/java
* pinpoint agent 설치
- agent 압축 해제
> mkdir pinpoint-agent
> tar xvfz pinpoint-agent-1.8.4.tar.gz -C ./pinpoint-agent
> mv pinpoint-agent /home/user1/pinpoint
- 설정
# 로깅 설정
> vi /home/user1/pinpoint/pinpoint-agent/lib/log4j.xml
# collector 주소 및 각종 설정
> vi /home/user1/pinpoint/pinpoint-agent/pinpoint.config
- agent 적용
application으로 spring boot 소스 사용 : [spring boot 2.1.7] hibernate - mysql 5.7 연동 설정
> git clone https://github.com/yamoe/spring-boot-example
> cd spring-boot-example/06.hibernate-mysql/arti
> chmod +x gradlew
> ./gradlew clean build -Pprofile=prod
> cd build/libs
# 실행 테스트
#> java -jar -Dspring.profiles.active=common arti.jar
agent 포함하여 실행
> AGENT_PATH=/home/user1/pinpoint/pinpoint-agent
> java -jar -javaagent:$AGENT_PATH/pinpoint-bootstrap-1.8.4.jar -Dpinpoint.agentId=sba01 -Dpinpoint.applicationName=SpringBootApp -Dspring.profiles.active=common arti.jar
pinpoint.agentId : 고유 ID
pinpoint.applicationName : 그룹 ID
- 실행 확인
-- mysql select 페이지 : http://192.168.56.101:9999/jpa/select
-- pinpoint web 화면 : http://192.168.56.101:8080/
* 그외 - 추가 설정해야 동작하는 기능
- Alarm
https://github.com/naver/pinpoint/blob/master/doc/alarm.md#alarm-1
특정 조건에 알람을 받을 수 있는 기능
- Application Inspector
https://github.com/naver/pinpoint/blob/master/doc/application-inspector.md#application-inspector-1
Agent의 리소스 상태(cpu, mem, tps, datasource connection count) 집계 및 출력
- HTTP Status Code Failure
https://github.com/naver/pinpoint/blob/master/doc/http-status-code-failure.md
특정 HTTP Code 인 경우 실패로 조회할 수 있도록 설정
- Proxy HTTP Header
https://github.com/naver/pinpoint/blob/master/doc/proxy-http-header.md
proxy(nginx 같은..) 와 WAS(tomcat, ...) 간의 통신 경과시간 모니터링
'Java' 카테고리의 다른 글
[nGrinder 3.4.3] 설치 (0) | 2019.09.13 |
---|---|
[scouter 2.7.0] 설치 (0) | 2019.09.04 |
[pinpoint 1.8.4] 설치 준비 - tomcat 9.0.24 (1) | 2019.09.01 |
[pinpoint 1.8.4] 설치 준비 - hbase 1.2.7 standalone (0) | 2019.09.01 |
[spring boot 2.1.7] hibernate - mysql 5.7 연동 설정 (0) | 2019.08.30 |
[spring boot 2.1.7] mybatis - mysql 5.7 연동 (0) | 2019.08.29 |
[spring boot 2.1.7] thymelef 설정 (0) | 2019.08.29 |
[spring boot 2.1.7] JSP 설정 (0) | 2019.08.29 |