Fork me on GitHub

PinPoint-Deploy[部署]

Pinpoint is an APM (Application Performance Management) tool for large-scale distributed systems written in Java.

系统架构

  • 架构图

架构图

组件:

  • pinpoint-collector-1.7.3.war (数据收集)

  • pinpoint-web-1.7.3.war (页面展示)

  • pinpoint-agent-1.7.3.tar.gz (数据采集)

所需环境

版本适配信息

  • Tomcat-8.5.32(web container)
  • Hbase-1.2.6 (for storage)

部署步骤

  1. 安装HBase

    • 创建监控所需的HBase 表
  2. 下载最新PinPoint执行文件(或自行git clone —> maven build)

    • The current stable version is v1.7.3.
    • DownLoad
  3. 部署 Pinpoint Collector

    • 解压 pinpoint-collector-$VERSION.warTomcat 容器
    • 修改 pinpoint-collector.properties, hbase.properties 文件
  4. 部署 Pinpoint Web

    • 解压 pinpoint-web-$VERSION.warTomcat 容器
    • 修改 pinpoint-web, hbase.properties 文件
  5. 启动Tomcat

  6. 部署 Pinpoint Agent

    • 解压 pinpoint-agent 压缩包
    • 设置 -javaagent:$AGENT_PATH/pinpoint-bootstrap-$VERSION.jar JVM参数到 App Jar 启动参数
    • 设置 -Dpinpoint.agentId and -Dpinpoint.applicationName 到 App Jar 启动参数
    • 启动Java App

部署

  • Tomcat 两个webapp实例
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
......
<Service name="Catalina1">
<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Engine name="Catalina1" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="/home/wxmimperio/software/apache-tomcat-8.5.32/pinpoint-web" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
</Service>

<Service name="Catalina2">
<Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Engine name="Catalina2" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="/home/wxmimperio/software/apache-tomcat-8.5.32/pinpoint-collector" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
</Service>
......
  • 初始化Hbase 监控表
1
2
3
4
5
# https://github.com/naver/pinpoint/blob/master/hbase/scripts/hbase-create.hbase

vim hbase-create.hbase

hbase shell hbase-create.hbase
  • pinpoint-web

解压war,修改配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
# unzip pinpoint-web-1.7.3.war -d pinpoint-web-1.7.3

# /apache-tomcat-8.5.32/pinpoint-web/pinpoint-web-1.7.3/WEB-INF/classes

vim hbase.properties
# 设置hbase地址
hbase.client.host=192.168.1.110
hbase.client.port=2181

vim pinpoint-web.properties
# 关闭集群模式
cluster.enable=false
  • pinpoint-collector
1
2
3
4
5
6
7
8
9
10
11
12
# unzip pinpoint-collector-1.7.3.war -d pinpoint-collector-1.7.3

# /apache-tomcat-8.5.32/pinpoint-collector/pinpoint-collector-1.7.3/WEB-INF/classes

vim hbase.properties
# 设置hbase地址
hbase.client.host=192.168.1.110
hbase.client.port=2181

vim pinpoint-collector.properties
# 关闭集群模式
cluster.enable=false
  • 重启Tomcat
1
2
3
./startup.sh

# http://192.168.1.110:8081/pinpoint-web-1.7.3/#/main
  • 部署应用
1
java -javaagent:/home/wxmimperio/software/pinpoint/pinpoint-agent-1.7.3/pinpoint-bootstrap-1.7.3.jar -Dpinpoint.agentId=wxm-consumer -Dpinpoint.applicationName=wxm-consumer -jar spring-boot-test-1.0-SNAPSHOT.jar

应用拓扑

应用Trace

Thank you for your support.