PinPoint 安装指南 (三种安装方法)
有两种安装方式,一种是通过docker-compose安装,另一种就是手动自己安装
1、Docker方式安装
安装docker docker-compose
yum update -y
yum install docker epel-release python-pip -y
pip install --upgrade pip
pip install docker-compose
修改daemon.json
[root@i-vzdytl5t ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["http://579fe187.m.daocloud.io","https://pee6w651.mirror.aliyuncs.com"]
}
启动docker
systemctl enable docker
systemctl start docker
下载pinpoint-docker,启动pinpoint服务
git clone https://github.com/naver/pinpoint-docker.git
cd Pinpoint-Docker
docker-compose pull && docker-compose up -d
如有问题,请修改相对路径为绝对路径
...
volumes:
- /home/pinpoint/hbase
- /home/pinpoint/zookeeper
...
镜像
root@i-vzdytl5t pinpoint-docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/zookeeper 3.4 bf5cbc9d5cac 10 days ago 146 MB
docker.io/pinpointdocker/pinpoint-agent 1.7.3 d10e8ad4472e 11 days ago 18.5 MB
docker.io/pinpointdocker/pinpoint-hbase 1.7.3 24ec151afe93 11 days ago 993 MB
docker.io/pinpointdocker/pinpoint-web 1.7.3 cfffbb994f1b 11 days ago 659 MB
docker.io/pinpointdocker/pinpoint-collector 1.7.3 998b986648a8 11 days ago 604 MB
docker.io/pinpointdocker/pinpoint-quickstart latest 125fa49a4a38 2 weeks ago 566 MB
docker.io/flink 1.3.1 c08ccd5bb7a6 10 months ago 480 MB
启动完成后所起的容器
[root@i-vzdytl5t pinpoint-docker]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
770e180203e9 pinpointdocker/pinpoint-quickstart "catalina.sh run" 3 hours ago Up 3 hours 0.0.0.0:8000->8080/tcp pinpoint-quickstart
968c689aad3d pinpointdocker/pinpoint-agent:1.7.3 "/usr/local/bin/co..." 3 hours ago Up 3 hours pinpoint-agent
19fac27003e3 pinpointdocker/pinpoint-web:1.7.3 "/usr/local/bin/st..." 3 hours ago Up 3 hours 0.0.0.0:9997->9997/tcp, 0.0.0.0:8079->8080/tcp pinpoint-web
08f7242e3612 pinpointdocker/pinpoint-collector:1.7.3 "/usr/local/bin/st..." 3 hours ago Up 3 hours 8080/tcp, 0.0.0.0:9994-9996->9994-9996/tcp, 0.0.0.0:9995-9996->9995-9996/udp pinpoint-collector
23262f75eec0 pinpointdocker/pinpoint-hbase:1.7.3 "/bin/sh -c '${BAS..." 3 hours ago Up 3 hours 0.0.0.0:16010->16010/tcp, 0.0.0.0:16030->16030/tcp, 0.0.0.0:60000->60000/tcp, 0.0.0.0:60020->60020/tcp, 0.0.0.0:2180->2181/tcp pinpoint-hbase
f0525f78484e flink:1.3.1 "/docker-entrypoin..." 4 hours ago Up 4 hours 6123/tcp, 0.0.0.0:6121-6122->6121-6122/tcp, 0.0.0.0:19994->19994/tcp, 8081/tcp pinpoint-flink-taskmanager
ec7959d91bab zookeeper:3.4 "/docker-entrypoin..." 4 hours ago Up 4 hours 2181/tcp, 2888/tcp, 3888/tcp pinpoint-docker_zoo3_1
67fe5108a1f8 zookeeper:3.4 "/docker-entrypoin..." 4 hours ago Up 4 hours 2181/tcp, 2888/tcp, 3888/tcp pinpoint-docker_zoo2_1
ff751bd4ce44 zookeeper:3.4 "/docker-entrypoin..." 4 hours ago Up 4 hours 2181/tcp, 2888/tcp, 3888/tcp pinpoint-docker_zoo1_1
34ae285a9246 flink:1.3.1 "/docker-entrypoin..." 4 hours ago Up 4 hours 6123/tcp, 0.0.0.0:8081->8081/tcp pinpoint-flink-jobmanager
访问nodeIP:8079
hbase页面
docker安装成功
2、手动安装(快速启动)
安装jdk
jdk下载
http://www.oracle.com/technetwork/cn/java/archive-139210-zhs.html
下载之后的jdk
[root@i-vzdytl5t ~]# ls -l
total 401520
-rwxr-xr-x 1 root root 72087592 May 25 18:49 jdk-6u45-linux-x64 (2).bin
-rw-r--r-- 1 root root 153530841 May 25 18:44 jdk-7u80-linux-x64 (1).tar.gz
-rw-r--r-- 1 root root 185515842 May 25 18:45 jdk-8u144-linux-x64 (2).tar.gz
解压配置,配置jdk
chmod +x jdk-6u45-linux-x64 (2).bin
./jdk-6u45-linux-x64 (2).bin
tar -zxvf jdk-7u80-linux-x64\ \(1\).tar.gz
tar -zxvf jdk-8u144-linux-x64\ \(2\).tar.gz
[root@i-vzdytl5t ~]# ls -l
total 410128
-rw-r--r-- 1 root root 8799579 Feb 25 05:35 apache-maven-3.5.3-bin.tar.gz
drwxr-xr-x 3 root root 4096 May 25 19:18 demo
drwxr-xr-x 8 root root 4096 Mar 27 2013 jdk1.6.0_45
drwxr-xr-x 8 10 143 4096 Apr 11 2015 jdk1.7.0_80
drwxr-xr-x 8 10 143 4096 Jul 22 2017 jdk1.8.0_144
-rwxr-xr-x 1 root root 72087592 May 25 18:49 jdk-6u45-linux-x64 (2).bin
-rw-r--r-- 1 root root 153530841 May 25 18:44 jdk-7u80-linux-x64 (1).tar.gz
-rw-r--r-- 1 root root 185515842 May 25 18:45 jdk-8u144-linux-x64 (2).tar.gz
JDK6 installed (jdk1.6.0\_45 recommended)
JDK7 installed (jdk1.7.0\_80 recommended)
JDK8 installed
JAVA\_HOME environment variable set to JDK 8+ home directory.
JAVA\_6\_HOME environment variable set to JDK 6 home directory.
JAVA\_7\_HOME environment variable set to JDK 7 home directory.
JAVA\_8\_HOME environment variable set to JDK 8 home directory.
export JAVA_HOME=/root/jdk1.8.0_144
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
root@i-vzdytl5t jdk1.8.0_144]# java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
export JAVA_6_HOME=/root/jdk1.6.0_45
export JAVA_7_HOME=/root/jdk1.7.0_80
export JAVA_8_HOME=/root/jdk1.8.0_144
下载安装maven以及配置maven
wget http://archive.apache.org/dist/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz
tar -zxvf apache-maven-3.5.3-bin.tar.gz
export M2_HOME=/root/apache-maven-3.5.3
export PATH=$PATH:$M2_HOME/bin
[root@i-vzdytl5t ~]# mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: /root/apache-maven-3.5.3
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /root/jdk1.8.0_144/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-327.4.5.el7.x86_64", arch: "amd64", family: "unix"
下载pinpoint代码
git clone https://github.com/naver/pinpoint.git
git checkout 1.7.3
启动pinpoint
./mvnw install -Dmaven.test.skip=true
INFO] Reactor Build Order:
[INFO]
[INFO] pinpoint
[INFO] pinpoint-annotations
[INFO] pinpoint-thrift
[INFO] pinpoint-commons
[INFO] pinpoint-bootstrap-core
[INFO] pinpoint-bootstrap
[INFO] pinpoint-rpc
[INFO] pinpoint-profiler
[INFO] pinpoint-commons-hbase
[INFO] pinpoint-commons-server
[INFO] pinpoint-profiler-test
[INFO] pinpoint-profiler-optional-parent
[INFO] pinpoint-profiler-optional-jdk6
[INFO] pinpoint-profiler-optional-jdk7
[INFO] pinpoint-profiler-optional
[INFO] pinpoint-httpclient3-plugin
[INFO] pinpoint-httpclient4-plugin
[INFO] pinpoint-ning-asynchttpclient-plugin
[INFO] pinpoint-resttemplate-plugin
[INFO] pinpoint-netty-plugin
[INFO] pinpoint-gson-plugin
[INFO] pinpoint-cubrid-jdbc-driver-plugin
[INFO] pinpoint-mysql-jdbc-driver-plugin
[INFO] pinpoint-mariadb-jdbc-driver-plugin
[INFO] pinpoint-postgresql-jdbc-driver-plugin
[INFO] pinpoint-jtds-plugin
[INFO] pinpoint-oracle-jdbc-driver-plugin
[INFO] pinpoint-commons-dbcp-plugin
[INFO] pinpoint-commons-dbcp2-plugin
[INFO] pinpoint-hikaricp-plugin
[INFO] pinpoint-test
[INFO] pinpoint-cassandra-driver-plugin
[INFO] pinpoint-jdk-http-plugin
[INFO] pinpoint-redis-plugin
[INFO] pinpoint-tomcat-plugin
[INFO] pinpoint-json-lib-plugin
[INFO] pinpoint-jackson-plugin
[INFO] pinpoint-thrift-plugin
[INFO] pinpoint-user-plugin
[INFO] pinpoint-arcus-plugin
[INFO] pinpoint-google-httpclient-plugin
[INFO] pinpoint-jetty-plugin
[INFO] pinpoint-websphere-plugin
[INFO] pinpoint-spring-plugin
[INFO] pinpoint-spring-boot-plugin
[INFO] pinpoint-ibatis-plugin
[INFO] pinpoint-mybatis-plugin
[INFO] pinpoint-okhttp-plugin
[INFO] pinpoint-log4j-plugin
[INFO] pinpoint-logback-plugin
[INFO] pinpoint-dubbo-plugin
[INFO] pinpoint-activemq-client-plugin
[INFO] pinpoint-cxf-plugin
[INFO] pinpoint-hystrix-plugin
[INFO] pinpoint-jboss-plugin
[INFO] pinpoint-vertx-plugin
[INFO] pinpoint-resin-plugin
[INFO] pinpoint-jsp-plugin
[INFO] pinpoint-rxjava-plugin
[INFO] pinpoint-rabbitmq-plugin
[INFO] pinpoint-plugins
[INFO] pinpoint-bootstrap-core-optional
[INFO] pinpoint-tools
[INFO] pinpoint-agent-distribution
[INFO] pinpoint-collector
[INFO] pinpoint-profiler-optional-jdk8
[INFO] pinpoint-web
[INFO] pinpoint-hbase-distribution
[INFO] pinpoint-flink
[INFO]
...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36:18 min
[INFO] Finished at: 2018-05-26T01:21:37+08:00
[INFO] Final Memory: 91M/464M
[INFO] ------------------------------------------------------------------------
注意,编译好了的都在xxx/target目录下,例如
root@i-vzdytl5t target]# ls -l
total 78364
drwxr-xr-x 2 root root 4096 May 26 01:13 antrun
drwxr-xr-x 6 root root 4096 May 26 01:18 classes
drwxr-xr-x 13 root root 4096 May 26 01:18 deploy
drwxr-xr-x 2 root root 4096 May 26 01:17 etc
drwxr-xr-x 3 root root 4096 May 26 01:18 generated-sources
drwxr-xr-x 2 root root 4096 May 26 01:13 grunt
-rw-r--r-- 1 root root 3069 May 26 01:13 Gruntfile.js
drwxr-xr-x 3 root root 4096 May 26 01:13 main
drwxr-xr-x 2 root root 4096 May 26 01:18 maven-archiver
drwxr-xr-x 3 root root 4096 May 26 01:18 maven-status
drwxr-xr-x 3 root root 4096 May 26 01:17 node
drwxr-xr-x 372 root root 12288 May 26 01:18 node_modules
-rw-r--r-- 1 root root 1053 May 26 01:13 package.json
-rw-r--r-- 1 root root 1203078 May 26 01:18 pinpoint-web-1.7.3-classes.jar
-rw-r--r-- 1 root root 78978485 May 26 01:18 pinpoint-web-1.7.3.war
[root@i-vzdytl5t pinpoint]# cd agent/target/
[root@i-vzdytl5t target]# ls -l
total 17468
drwxr-xr-x 2 root root 4096 May 26 01:11 archive-tmp
drwxr-xr-x 3 root root 4096 May 26 01:11 classes
drwxr-xr-x 2 root root 4096 May 26 01:11 maven-archiver
drwxr-xr-x 7 root root 4096 May 26 01:11 pinpoint-agent-1.7.3
-rw-r--r-- 1 root root 14600 May 26 01:11 pinpoint-agent-1.7.3.jar
-rw-r--r-- 1 root root 8910184 May 26 01:11 pinpoint-agent-1.7.3.tar.gz
-rw-r--r-- 1 root root 8941382 May 26 01:11 pinpoint-agent-1.7.3.zip
下载hbase
wget http://mirrors.hust.edu.cn/apache/hbase/2.0.0/hbase-2.0.0-bin.tar.gz
tar -zxvf hbase-2.0.0-bin.tar.gz
mv hbase-2.0.0 hbase-1.0.3
mkdir hbase
cp -r hbase-1.0.3/* hbase/
cp -r hbase-1.0.3 /root/demo/pinpoint/quickstart/hbase/
cp -r hbase /root/demo/pinpoint/quickstart/hbase/
启动hbase
[root@i-vzdytl5t pinpoint]# ./quickstart/bin/start-hbase.sh
HBase already installed. Starting hbase...
running master, logging to /root/demo/pinpoint/quickstart/hbase/hbase-1.0.3/bin/../logs/hbase-root-master-i-vzdytl5t.out
[root@i-vzdytl5t pinpoint]# netstat -tlnp
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 4004/sshd
tcp6 0 0 :::16010 :::* LISTEN 20257/java
tcp6 0 0 127.0.1.1:16020 :::* LISTEN 20257/java
tcp6 0 0 :::22 :::* LISTEN 4004/sshd
tcp6 0 0 :::16030 :::* LISTEN 20257/java
tcp6 0 0 127.0.1.1:16000 :::* LISTEN 20257/java
tcp6 0 0 :::2181 :::* LISTEN 20257/java
初始化hbase
root@i-vzdytl5t pinpoint]# ./quickstart/bin/init-hbase.sh
2018-05-25 23:48:24,964 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Created table AgentInfo
Took 1.1577 seconds
Created table AgentStatV2
Took 2.2787 seconds
Created table ApplicationStatAggre
Took 1.2341 seconds
Created table ApplicationIndex
Took 0.7214 seconds
Created table AgentLifeCycle
Took 0.7177 seconds
Created table AgentEvent
Took 0.7194 seconds
Created table StringMetaData
Took 0.7167 seconds
Created table ApiMetaData
Took 0.7173 seconds
Created table SqlMetaData_Ver2
Took 0.7188 seconds
Created table TraceV2
Took 4.2439 seconds
Created table ApplicationTraceIndex
Took 0.7191 seconds
Created table ApplicationMapStatisticsCaller_Ver2
Took 0.7166 seconds
Created table ApplicationMapStatisticsCallee_Ver2
Took 0.7990 seconds
Created table ApplicationMapStatisticsSelf_Ver2
Took 0.7151 seconds
Created table HostApplicationMap_Ver2
Took 0.7154 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)
Took 0.0661 seconds
[root@i-vzdytl5t bin]# jps
20257 HMaster
14066 Jps
9638 MavenWrapperMain
启动并且导入成功
启动Collector
quickstart/bin/start-collector.sh //还要进行编译
root@i-vzdytl5t pinpoint]# quickstart/bin/start-collector.sh
---check pinpoint-quickstart-collector process status.---
---initialize pinpoint-quickstart-collector logs.---
rm /root/demo/pinpoint/quickstart/logs/quickstart.collector.log.
rm /root/demo/pinpoint/quickstart/logs/pid/quickstart.collector.pid.
---pinpoint-quickstart-collector initialization started. pid=21446.---g
starting pinpoint-quickstart-collector. 0 /3600 sec(close wait limit).
starting pinpoint-quickstart-collector. 100 /3600 sec(close wait limit).
starting pinpoint-quickstart-collector. 200 /3600 sec(close wait limit).
starting pinpoint-quickstart-collector. 300 /3600 sec(close wait limit).
starting pinpoint-quickstart-collector. 400 /3600 sec(close wait limit).
---pinpoint-quickstart-collector initialization completed. pid=21446.---
2018-05-26 06:54:12 [INFO ](utowiredAnnotationBeanPostProcessor:155) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-05-26 06:54:13 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/admin/enableAccess],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.navercorp.pinpoint.collector.manage.controller.HandlerManagerController.enableAccess()
2018-05-26 06:54:13 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/admin/disableAccess],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.navercorp.pinpoint.collector.manage.controller.HandlerManagerController.disableAccess()
2018-05-26 06:54:13 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/admin/isEnable],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.navercorp.pinpoint.collector.manage.controller.HandlerManagerController.isEnable()
2018-05-26 06:54:13 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/serverTime],methods=[GET]}" onto public com.navercorp.pinpoint.collector.controller.ServerTimeController$ServerTime com.navercorp.pinpoint.collector.controller.ServerTimeController.getServerTime()
2018-05-26 06:54:13 [INFO ](.m.m.a.RequestMappingHandlerAdapter:534) Looking for @ControllerAdvice: WebApplicationContext for namespace 'pinpoint-web-servlet': startup date [Sat May 26 06:54:12 CST 2018]; parent: Root WebApplicationContext
2018-05-26 06:54:13 [INFO ](.m.m.a.RequestMappingHandlerAdapter:534) Looking for @ControllerAdvice: WebApplicationContext for namespace 'pinpoint-web-servlet': startup date [Sat May 26 06:54:12 CST 2018]; parent: Root WebApplicationContext
2018-05-26 06:54:13 [INFO ](o.s.w.s.DispatcherServlet :508) FrameworkServlet 'pinpoint-web': initialization completed in 1150 ms
May 26, 2018 6:54:13 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-28082"]
2018-05-26 06:58:26 [DEBUG](c.n.p.r.s.HealthCheckManager :100) registerTask() started
启动Web UI
//Web UI
quickstart/bin/start-web.sh
[root@i-vzdytl5t pinpoint]# quickstart/bin/start-web.sh
---check pinpoint-quickstart-web process status.---
---initialize pinpoint-quickstart-web logs.---
rm /root/demo/pinpoint/quickstart/logs/quickstart.web.log.
rm /root/demo/pinpoint/quickstart/logs/pid/quickstart.web.pid.
---pinpoint-quickstart-web initialization started. pid=26413.---
starting pinpoint-quickstart-web. 0 /180 sec(close wait limit).
starting pinpoint-quickstart-web. 5 /180 sec(close wait limit).
starting pinpoint-quickstart-web. 10 /180 sec(close wait limit).
starting pinpoint-quickstart-web. 15 /180 sec(close wait limit).
starting pinpoint-quickstart-web. 20 /180 sec(close wait limit).
starting pinpoint-quickstart-web. 25 /180 sec(close wait limit).
---pinpoint-quickstart-web initialization completed. pid=26413.---
2018-05-26 07:01:46 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/userGroup],methods=[GET]}" onto public java.util.List<com.navercorp.pinpoint.web.vo.UserGroup> com.navercorp.pinpoint.web.controller.UserGroupController.getUserGroup(java.lang.String,java.lang.String)
2018-05-26 07:01:46 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/userGroup/member],methods=[POST]}" onto public java.util.Map<java.lang.String, java.lang.String> com.navercorp.pinpoint.web.controller.UserGroupController.insertUserGroupMember(com.navercorp.pinpoint.web.vo.UserGroupMemberParam,java.lang.String)
2018-05-26 07:01:46 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/userGroup/member],methods=[DELETE]}" onto public java.util.Map<java.lang.String, java.lang.String> com.navercorp.pinpoint.web.controller.UserGroupController.deleteUserGroupMember(com.navercorp.pinpoint.web.vo.UserGroupMemberParam,java.lang.String)
2018-05-26 07:01:46 [INFO ](.m.m.a.RequestMappingHandlerMapping:543) Mapped "{[/userGroup/member],methods=[GET]}" onto public java.util.List<com.navercorp.pinpoint.web.vo.UserGroupMember> com.navercorp.pinpoint.web.controller.UserGroupController.getUserGroupMember(java.lang.String)
2018-05-26 07:01:46 [INFO ](.m.m.a.RequestMappingHandlerAdapter:534) Looking for @ControllerAdvice: WebApplicationContext for namespace 'pinpoint-web-servlet': startup date [Sat May 26 07:01:45 CST 2018]; parent: Root WebApplicationContext
2018-05-26 07:01:46 [INFO ](.m.m.a.RequestMappingHandlerAdapter:534) Looking for @ControllerAdvice: WebApplicationContext for namespace 'pinpoint-web-servlet': startup date [Sat May 26 07:01:45 CST 2018]; parent: Root WebApplicationContext
2018-05-26 07:01:46 [INFO ](a.ExceptionHandlerExceptionResolver:273) Detected @ExceptionHandler methods in controllerExceptionHandler
2018-05-26 07:01:46 [INFO ](o.s.w.s.DispatcherServlet :508) FrameworkServlet 'pinpoint-web': initialization completed in 966 ms
May 26, 2018 7:01:46 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-28080"]
启动测试APP
//TestApp
quickstart/bin/start-testapp.sh
[root@i-vzdytl5t pinpoint]# quickstart/bin/start-testapp.sh
---check pinpoint-quickstart-testapp process status.---
---initialize pinpoint-quickstart-testapp logs.---
rm LOGS_DIR/quickstart.testapp.log.
---initialize pinpoint-quickstart-testapp agent.---
---pinpoint-quickstart-testapp initialization started. pid=19975.---
starting pinpoint-quickstart-testapp. 0 /180 sec(close wait limit).
starting pinpoint-quickstart-testapp. 5 /180 sec(close wait limit).
starting pinpoint-quickstart-testapp. 10 /180 sec(close wait limit).
starting pinpoint-quickstart-testapp. 15 /180 sec(close wait limit).
starting pinpoint-quickstart-testapp. 20 /180 sec(close wait limit).
starting pinpoint-quickstart-testapp. 25 /180 sec(close wait limit).
starting pinpoint-quickstart-testapp. 30 /180 sec(close wait limit).
---pinpoint-quickstart-testapp initialization completed. pid=19975.---
2018-05-26 07:04:41 [DEBUG](c.n.p.b.i.BasicMethodInterceptor :97 ) BEFORE org.springframework.web.servlet.DispatcherServlet args:(RequestFacade, ResponseFacade)
2018-05-26 07:04:41 [DEBUG](c.n.p.b.i.BasicMethodInterceptor :97 ) BEFORE com.fasterxml.jackson.databind.ObjectMapper args:(UTF8JsonGenerator, HashMap)
2018-05-26 07:04:41 [DEBUG](c.n.p.b.i.BasicMethodInterceptor :151) AFTER com.fasterxml.jackson.databind.ObjectMapper args:(UTF8JsonGenerator, HashMap)
2018-05-26 07:04:41 [DEBUG](c.n.p.b.i.BasicMethodInterceptor :151) AFTER org.springframework.web.servlet.DispatcherServlet args:(RequestFacade, ResponseFacade)
2018-05-26 07:04:41 [DEBUG](.StandardHostValveInvokeInterceptor:122) AFTER org.apache.catalina.core.StandardHostValve args:(Request, Response) result:null
2018-05-26 07:04:41 [DEBUG](c.n.p.b.p.h.HttpStatusCodeRecorder :285) Record HTTP status code annotation. status-code=200
访问http://10.39.43.117:28080/(nodeIP:28080)
用户管理
安装应用
这三个必须唯一
-javaagent:${
pinpointPath}/pinpoint-bootstrap-1.7.3.jar
-Dpinpoint.applicationName=ddd
-Dpinpoint.agentId=ddd
访问http://10.39.43.117:28081/(nodeIP:28081)
停止命令
//Web UI
quickstart/bin/stop-web.sh
//TestApp
quickstart/bin/stop-testapp.sh
//Collector
quickstart/bin/stop-collector.sh
//HBase
quickstart/bin/stop-hbase.sh
例如
[root@i-vzdytl5t pinpoint]# quickstart/bin/stop-web.sh
---pinpoint-quickstart-web destroy started..---
shutting down pinpoint-quickstart-web. pid=26413.
---pinpoint-quickstart-web destroy completed.---
---clear pinpoint-quickstart-web logs.---
rm /root/demo/pinpoint/quickstart/logs/quickstart.web.log.
rm /root/demo/pinpoint/quickstart/logs/pid/quickstart.web.pid.
[root@i-vzdytl5t pinpoint]# quickstart/bin/stop-testapp.sh
---pinpoint-quickstart-testapp destroy started..---
shutting down pinpoint-quickstart-testapp. pid=19975.
---pinpoint-quickstart-testapp destroy completed.---
---clear pinpoint-quickstart-testapp logs.---
rm /root/demo/pinpoint/quickstart/logs/quickstart.testapp.log.
rm /root/demo/pinpoint/quickstart/logs/pid/quickstart.testapp.pid.
[root@i-vzdytl5t pinpoint]# quickstart/bin/stop-collector.sh
---pinpoint-quickstart-collector destroy started..---
shutting down pinpoint-quickstart-collector. pid=21446.
---pinpoint-quickstart-collector destroy completed.---
---clear pinpoint-quickstart-collector logs.---
rm /root/demo/pinpoint/quickstart/logs/quickstart.collector.log.
rm /root/demo/pinpoint/quickstart/logs/pid/quickstart.collector.pid.
[root@i-vzdytl5t pinpoint]# quickstart/bin/stop-hbase.sh
Cannot find hbase installation. Exiting.
[root@i-vzdytl5t pinpoint]#
3、手动安装(非快速启动)
主要主件,注意pinpoint的分支为1.7.3
HBase (for storage)
Pinpoint Collector (deployed on a web container)
Pinpoint Web (deployed on a web container)
Pinpoint Agent (attached to a java application for profiling)
安装hbase
wget http://archive.apache.org/dist/hbase/1.2.6/hbase-1.2.6-bin.tar.gz
解压
tar -zxvf hbase-1.2.6-bin.tar.gz
启动并初始化hbase
export JAVA_HOME=/root/jdk1.8.0_144
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
export JAVA_6_HOME=/root/jdk1.6.0_45
export JAVA_7_HOME=/root/jdk1.7.0_80
export JAVA_8_HOME=/root/jdk1.8.0_144
export M2_HOME=/root/apache-maven-3.5.3
export PATH=$PATH:$M2_HOME/bin
mkdir -p /data/service
mv hbase-1.2.6 /data/service/hbase
修改hbase-env.sh的JAVA_HOME环境变量位置
启动hbase
cd /data/service/hbase/bin
[root@i-vzdytl5t bin]# ./start-hbase.sh
master running as process 20257. Stop it first.
查看是否启动成功
[root@i-vzdytl5t bin]# jps
20257 HMaster
22490 MavenWrapperMain
28111 Jps
初始化Hbase的pinpoint库
[root@i-vzdytl5t bin]# pwd
/data/service/hbase/bin
./hbase shell /root/demo/pinpoint/hbase/scripts/hbase-create.hbase
...
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.0370 seconds
执行完了以后,进入Hbase
[root@i-vzdytl5t bin]# ./hbase shell
2018-05-26 08:19:20,377 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017
hbase(main):001:0>
输入”status ‘detailed’”可以查看刚才初始化的表,是否存在
hbase(main):008:0* status 'detailed'
登录页面查看也可以,nodeIP:16010
编译pinpoint
这一步比较慢,可略过,直接下载releases
[root@i-vzdytl5t pinpoint]# pwd
/root/demo/pinpoint
./mvnw install -Dmaven.test.skip=true
安装Pinpoint Collector
下载tomcat
wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar.gz
tar -zvxf apache-tomcat-8.5.31-embed.tar.gz
[root@i-vzdytl5t ~]# mkdir /data/service/pp-col
[root@i-vzdytl5t ~]# cp -r apache-tomcat-8.5.31 /data/service/pp-col/
修改tomcat端口 注意:最后一条是将tomcat的私有ip开放,需要将localhost替换成本机的ip,我本机的网卡是默认的,如果你本机的网卡不是eth0,需要进行相关的修改。或者直接用"vi"进去,修改localhost
[root@i-vzdytl5t conf]# pwd
/data/service/pp-col/apache-tomcat-8.5.31/conf
sed -i 's/port="8005"/port="18005"/g' server.xml
sed -i 's/port="8080"/port="18080"/g' server.xml
sed -i 's/port="8443"/port="18443"/g' server.xml
sed -i 's/port="8009"/port="18009"/g' server.xml
sed -i 's/redirectPort="8443"/redirectPort="18443"/g' server.xml
vi server.xml
<Host name="10.39.43.117" appBase="webapps"
unpackWARs="true" autoDeploy="true">
部署pinpoint-collector.war包
yum install unzip -y
cd /data/service/pp-col/apache-tomcat-8.5.31/webapps
rm -rf *
cp /root/demo/pinpoint/collector/target/pinpoint-collector-1.7.3.war .
unzip pinpoint-collector-1.7.3.war -d /data/service/pp-col/webapps/ROOT
rm -rf pinpoint-collector-1.7.3.war
[root@i-vzdytl5t webapps]# ls -l ROOT/
total 12
drwxr-xr-x 3 root root 4096 May 26 01:11 META-INF
drwxr-xr-x 2 root root 4096 May 26 01:11 monitor
drwxr-xr-x 4 root root 4096 May 26 01:11 WEB-INF
相关的配置文件在目录WEB-INF/classes/
[root@i-vzdytl5t classes]# pwd
/data/service/pp-col/apache-tomcat-8.5.31/webapps/ROOT/WEB-INF/classes
[root@i-vzdytl5t classes]# ls -l
total 72
-rw-r--r-- 1 root root 487 May 26 01:11 applicationContext-collector-namespace.xml
-rw-r--r-- 1 root root 22779 May 26 01:11 applicationContext-collector.xml
-rw-r--r-- 1 root root 8671 May 26 01:11 applicationContext-hbase.xml
drwxr-xr-x 3 root root 4096 May 26 01:11 com
-rw-r--r-- 1 root root 4188 May 26 01:11 deprecated-pinpoint-collector.properties
-rw-r--r-- 1 root root 1286 May 26 01:11 hbase.properties
-rw-r--r-- 1 root root 1920 May 26 01:11 log4j.xml
-rw-r--r-- 1 root root 4338 May 26 01:11 pinpoint-collector.properties
-rw-r--r-- 1 root root 2011 May 26 01:11 servlet-context.xml
配置相关说明请参考pinpoint-collector
启动Collector Tomcat
root@i-vzdytl5t bin]# ./startup.sh
Using CATALINA_BASE: /data/service/pp-col/apache-tomcat-8.5.31
Using CATALINA_HOME: /data/service/pp-col/apache-tomcat-8.5.31
Using CATALINA_TMPDIR: /data/service/pp-col/apache-tomcat-8.5.31/temp
Using JRE_HOME: /root/jdk1.8.0_144
Using CLASSPATH: /data/service/pp-col/apache-tomcat-8.5.31/bin/bootstrap.jar:/data/service/pp-col/apache-tomcat-8.5.31/bin/tomcat-juli.jar
Tomcat started.
查看日志,是否启动成功
tail -f ../logs/catalina.out
...
2018-05-26 09:15:10 [DEBUG](.p.r.c.DefaultPinpointClientFactory:100) createBootStrap boss:1, worker:1
2018-05-26 09:15:10 [INFO ](c.n.p.c.c.f.FlinkClusterService :60 ) flink cluster disable.
2018-05-26 09:15:10 [INFO ](o.s.w.c.ContextLoader :344) Root WebApplicationContext: initialization completed in 2938 ms
部署Pinpoint Web
mkdir /data/service/pp-web
cp -r apache-tomcat-8.5.31 /data/service/pp-web/
cd /data/service/pp-web/apache-tomcat-8.5.31/conf
sed -i 's/port="8005"/port="28005"/g' server.xml
sed -i 's/port="8080"/port="28080"/g' server.xml
sed -i 's/port="8443"/port="28443"/g' server.xml
sed -i 's/port="8009"/port="28009"/g' server.xml
sed -i 's/redirectPort="8443"/redirectPort="28443"/g' server.xml
<Engine name="Catalina" defaultHost="10.39.43.117">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="10.39.43.117" appBase="webapps"
unpackWARs="true" autoDeploy="true">
部署pinpoint-web.war包
[root@i-vzdytl5t webapps]# pwd
/data/service/pp-web/apache-tomcat-8.5.31/webapps
[root@i-vzdytl5t webapps]# rm -rf *
cp /root/demo/pinpoint/web/target/pinpoint-web-1.7.3.war .
unzip pinpoint-web-1.7.3.war -d /data/service/pp-web/apache-tomcat-8.5.31/webapps/ROOT
rm -rf pinpoint-web-1.7.3.war
相关的配置文件在WEB-INF/classes/
下,定义参考web-configuration
部署mysql数据库(告警要用到)参考alarm-implementation
yum install mariadb* -y
systemctl start mariadb
systemctl status mariadb
之后导入相关的表CreateTableStatement-mysql.sql SpringBatchJobRepositorySchema-mysql.sql
修改batch.properties
[root@i-vzdytl5t classes]# cat batch.properties
#batch enable config
batch.enable=true
#batch server ip to execute batch
batch.server.ip=127.0.0.1
#flink server list
batch.flink.server=
修改jdbc.properties
[root@i-vzdytl5t classes]# cat jdbc.properties
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/pinpoint?characterEncoding=UTF-8
jdbc.username=root
jdbc.password=qinzhao
启动web
[root@i-vzdytl5t bin]# ./startup.sh
Using CATALINA_BASE: /data/service/pp-web/apache-tomcat-8.5.31
Using CATALINA_HOME: /data/service/pp-web/apache-tomcat-8.5.31
Using CATALINA_TMPDIR: /data/service/pp-web/apache-tomcat-8.5.31/temp
Using JRE_HOME: /root/jdk1.8.0_144
Using CLASSPATH: /data/service/pp-web/apache-tomcat-8.5.31/bin/bootstrap.jar:/data/service/pp-web/apache-tomcat-8.5.31/bin/tomcat-juli.jar
Tomcat started.
查看web启动日志
tail -f ../logs/catalina.out
...
2018-05-26 09:36:45 [INFO ](o.s.c.s.DefaultLifecycleProcessor :343) Starting beans in phase 2147483647
2018-05-26 09:36:45 [INFO ](o.s.w.c.ContextLoader :344) Root WebApplicationContext: initialization completed in 4366 ms
这时候我们可以访问一下这个地址,在浏览器中输入”http://nodeIP:28080“,就会出现主页面了
配置pp-agent采集器
相关说明请参考Pinpoint Agent
这个需要用户在服务启动时添加上这个三行就可以了,是不是很酷
-javaagent:$AGENT_PATH/pinpoint-bootstrap-$VERSION.jar
pinpoint-bootstrap-VERSION的位置
-Dpinpoint.agentId=xxx
这里的agentId必须唯一,标志一个jvm。
-Dpinpoint.applicationName
applicationName表示同一种应用:同一个应用的不同实例应该使用不同的agentId,相同的applicationName。
例如
mv apache-tomcat-8.5.31 /data/service/pp-test
cd /data/service/pp-test
vi conf/server.xml
<Engine name="Catalina" defaultHost="10.39.43.117">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="10.39.43.117" appBase="webapps"
unpackWARs="true" autoDeploy="true">
cd /data/service
cp /root/demo/pinpoint/agent/target/pinpoint-agent-1.7.3.tar.gz .
mkidr pp-agent
cd pp-agent
tar -zvxf pinpoint-agent-1.7.3.tar.gz
vi pinpoint.config
profiler.collector.ip=10.39.43.117
修改tomcat的catalina.sh文件
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/data/service/pp-agent/pinpoint-bootstrap-1.7.3.jar"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=qinzhao-ID"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=qinzhao"
监控Tomcat
启动
./startup.sh
tail -f ../logs/catalina.out
tomcat
【注意】鼠标点击右上角箭头位置,鼠标左键按住不动,拉框查看。我被这个坑,坑懵逼了,特此写清楚。
4、flink的安装
以上是没有用到flink的情况,现在部署使用flink的情况
架构图
请参考flink