YUMSERV
article thumbnail
Published 2022. 4. 1. 13:56
APM - pinpoint설치 LINUX/WEB
반응형

1. 1. Pinpoint 정의

APM 이란 Application Performance Management 애플리케이션 성능 관리라는 뜻으로 웹 서비스의 성능 관리 및 향상을 도와주는 툴이다.

Pinpoint 란 대규모 애플리케이션의 성능 및 구조를 분석하고 문제를 진단 및 처리하는 분석 시스템 추적 플랫폼
Pinpoint github : https://github.com/pinpoint-apm/pinpoint

 

 

2. 2.  Pinpoint 설치

2-1) JAVA 설치

- JDK 다운로드 : ORACLE

<bash />
$ wget https://files-cdn.liferay.com/mirrors/download.oracle.com/otn-pub/java/jdk/8u121-b13/jdk-8u121-linux-x64.rpm $ rpm -Uvh jdk-8u121-linux-x64.rpm $ java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

 

- 환경변수 설정

<bash />
$ vi /root/.bash_profile export JAVA_HOME=/usr/java/jdk1.8.0_121 export JAVA_6_HOME=/usr/java/jdk1.6.0_45 export JAVA_7_HOME=/usr/java/jdk1.7.0_80 export JAVA_8_HOME=/usr/java/jdk1.8.0_121

 

2-2) HBase 설치

<bash />
$ wget http://archive.apache.org/dist/hbase/1.2.7/hbase-1.2.7-bin.tar.gz $ tar xvf hbase-1.2.7-bin.tar.gz # hbase 데이터 설정위치 $ vi hbase-1.2.7/conf/hbase-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hbase.rootdir</name> <value>file:///data/pinpoint/hbase-data/data</value> #데이터 디렉토리경로 </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/data/pinpoint/hbase-data/zookeeper</value> #zookeeper 디렉토리 경로 </property> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> <description> Controls whether HBase will check for stream capabilities (hflush/hsync). Disable this if you intend to run on LocalFileSystem, denoted by a rootdir with the 'file://' scheme, but be mindful of the NOTE below. WARNING: Setting this to false blinds you to potential data loss and inconsistent system state in the event of process and/or node failures. If HBase is complaining of an inability to use hsync or hflush it's most likely not a false positive. </description> </property> </configuration> # data, zookeeper 디렉토리 생성 $ mkdir -p /data/pinpoint/hbase-data/data $ mkdir -p /data/pinpoint/hbase-data/zookeeper

 

- Hbase 시작

<bash />
$ /data/hbase-1.2.7/bin/start-hbase.sh starting master, logging to /data/hbase-1.2.7/bin/../logs/hbase-root-master-mongo-shard1.out Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 $ netstat -nltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 26370/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1022/master tcp6 0 0 :::44309 :::* LISTEN 24743/java tcp6 0 0 :::22 :::* LISTEN 26370/sshd tcp6 0 0 xxx.xxx.xxx.xxx:41335 :::* LISTEN 24743/java tcp6 0 0 xxx.xxx.xxx.xxx:42117 :::* LISTEN 24743/java tcp6 0 0 :::2181 :::* LISTEN 24743/java tcp6 0 0 :::16010 :::* LISTEN 24743/java

 

- Hbase 스키마 생성

아래 github에 있는 파일을 다운로드 받습니다

https://github.com/pinpoint-apm/pinpoint/blob/master/hbase/scripts/hbase-create.hbase

<bash />
$ wget https://github.com/pinpoint-apm/pinpoint/blob/master/hbase/scripts/hbase-create.hbase $ sed 's/31536000/604800/' hbase-create.hbase > hbase-create-my.hbase $ sed -i 's/5184000/604800/' hbase-create-my.hbase $ /data/hbase-1.2.7/bin/hbase shell /data/hbase-create-my.hbase 2022-04-01 14:44:44,347 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 0 row(s) in 2.0200 seconds 0 row(s) in 8.5610 seconds 0 row(s) in 8.5340 seconds 0 row(s) in 1.3080 seconds 0 row(s) in 1.3150 seconds 0 row(s) in 1.3200 seconds 0 row(s) in 1.2780 seconds 0 row(s) in 2.3820 seconds 0 row(s) in 2.3350 seconds 0 row(s) in 18.6080 seconds 0 row(s) in 2.3240 seconds 0 row(s) in 2.2980 seconds 0 row(s) in 2.3430 seconds 0 row(s) in 2.3510 seconds 0 row(s) in 1.2630 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.0390 seconds


2-3) web,collector 다운로드 및 설정

pinpoint 2.1.0 이상부터는 tomcat을 설치하지 않고도, spring boot를 이용해서 실행이 가능합니다.
참고) https://github.com/pinpoint-apm/pinpoint/releases/tag/v2.1.2

 

Release 2.1.2 release notes · pinpoint-apm/pinpoint

Key Features Bugs [#7442] Fix NPE when SocketChannel state is connecting in KafkaPlugin

github.com

<bash />
$ wget https://github.com/pinpoint-apm/pinpoint/releases/download/v2.1.2/pinpoint-collector-boot-2.1.2.jar $ wget https://github.com/pinpoint-apm/pinpoint/releases/download/v2.1.2/pinpoint-web-boot-2.1.2.jar $ vi pinpoint-start.sh #!/bin/bash cd /data/pinpoint nohup java -jar -Dpinpoint.zookeeper.address=localhost pinpoint-collector-boot-2.1.2.jar >/dev/null 2>&1 & nohup java -jar -Dpinpoint.zookeeper.address=localhost pinpoint-web-boot-2.1.2.jar >/dev/null 2>&1 & $ chmod 755 pinpoint-start.sh $ ./pinpoint-start.sh $ netstat -nltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1098/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1032/master tcp6 0 0 xxx.xxx.xxx.xxx:41335 :::* LISTEN 24743/java tcp6 0 0 :::2181 :::* LISTEN 24743/java tcp6 0 0 :::9991 :::* LISTEN 11513/java tcp6 0 0 :::9992 :::* LISTEN 11513/java tcp6 0 0 :::9993 :::* LISTEN 11513/java tcp6 0 0 :::9994 :::* LISTEN 11513/java tcp6 0 0 :::16010 :::* LISTEN 24743/java tcp6 0 0 xxx.xxx.xxx.xxx:9997 :::* LISTEN 11514/java tcp6 0 0 :::8080 :::* LISTEN 11514/java tcp6 0 0 :::35664 :::* LISTEN 24743/java tcp6 0 0 :::8081 :::* LISTEN 11513/java tcp6 0 0 :::22 :::* LISTEN 1098/sshd tcp6 0 0 ::1:25 :::* LISTEN 1032/master tcp6 0 0 xxx.xxx.xxx.xxx:42117 :::* LISTEN 24743/java

 

2-4) Agent 설치

Tomcat 이 설치된 Agent 내에 Agent 파일을 풉니다

<bash />
$ wget https://github.com/pinpoint-apm/pinpoint/releases/download/v2.1.2/pinpoint-agent-2.1.2.tar.gz $ tar xvf pinpoint-agent-2.1.2.tar.gz $ vi /data/pinpoint/pinpoint-agent-2.1.2/pinpoint-root.config profiler.transport.grpc.collector.ip=COLLECTOR PUBLIC IP $ vi /data/pinpoint/pinpoint-agent-2.1.2/profiles/local/pinpoint.config profiler.transport.grpc.collector.ip=COLLECTOR PUBLIC IP profiler.transport.grpc.collector.ip=COLLECTOR PUBLIC IP $ vi /data/pinpoint/pinpoint-agent-2.1.2/profiles/release/pinpoint.config profiler.transport.grpc.collector.ip=COLLECTOR PUBLIC IP profiler.collector.ip=COLLECTOR PUBLIC IP $ vi /data/apache-tomcat-8.5.77/bin/catalina.sh JAVA_OPTS 추가 JAVA_OPTS="-javaagent:/data/pinpoint/pinpoint-agent-2.1.2/pinpoint-bootstrap-2.1.2.jar -Dpinpoint.agentId=tomcat_test -Dpinpoint.applicationName=tomcat_test" TOMCAT 재시작



3.  Pinpoint web 접속

1) WEB 접속

- COLLECTOR 서버 공인 아이피:8080 으로 접속합니다

- Agent를 설치하게 되면 어플리케이션 선택하는 부분에 생기게 되며, 모니터링이 가능합니다.

 

 


참조 URL)

https://velog.io/@developerlee79/Pinpoint-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0

 

 

Pinpoint 적용하기

회사에서 기존 서비스에 적용할 APM이 필요하여 여러 가지 방법을 찾아보던 중 네이버에서 개발한 Pinpoint를 도입하기로 결정했다.

velog.io

https://github.com/pinpoint-apm/pinpoint

 

GitHub - pinpoint-apm/pinpoint: APM, (Application Performance Management) tool for large-scale distributed systems.

APM, (Application Performance Management) tool for large-scale distributed systems. - GitHub - pinpoint-apm/pinpoint: APM, (Application Performance Management) tool for large-scale distributed sys...

github.com

https://velog.io/@developerlee79/Pinpoint-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0

 

Pinpoint 적용하기

회사에서 기존 서비스에 적용할 APM이 필요하여 여러 가지 방법을 찾아보던 중 네이버에서 개발한 Pinpoint를 도입하기로 결정했다.

velog.io

 

 

 

 

반응형
profile

YUMSERV

@lena04301

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!