Pinpoint installation and configuration

Pinpoint installation and configuration

Sanfeng soft Zhang Sanfeng

What is Pinpoint?

Pinpoint is a full link analysis tool that provides non-intrusive call chain monitoring, method execution details viewing, application status information monitoring and other functions. The implementation based on the GoogleDapper paper is similar to another open source full-link analysis tool Zipkin, but compared to Zipkin, it provides more features such as non-intrusive, code-dimensional monitoring. The functions supported by Pinpoint are relatively rich, and can support the following functions:

•Service topology diagram: Visually display the calling relationships of applications in the entire system. Click on a service node to display detailed information about the node, such as current node status, number of requests, etc.
•Real-time active thread diagram: monitor application The execution status of the active threads in the application can have a more intuitive understanding of the thread execution performance of the application.
Request response scatter diagram: display request count and response time in the time dimension, drag the chart to select the corresponding request to view the execution Details of the
request call stack view: Provides visibility into the code dimension for each request in a distributed environment. You can view the execution details of the request to the code dimension on the page to help find the bottleneck and the cause of the failure.
• Application status, machine status check: Through this function, you can view other detailed information of related applications, such as CPU usage, memory status, garbage collection status, TPS and JVM information and other parameters.

Architecture composition

Pinpoint is mainly composed of 3 components plus Hbase database. The three components are: Agent, Collector and Web UI.

•Agent component: used to collect application-side monitoring data, non-intrusive, only need to add some parameters to the startup command.
•Collector component: data collection module, receive monitoring data sent by Agent, and store it in HBase
•WebUI: Monitor display module, display system call relationship, call details, application status, etc., and support alarms and other functions.
Below are some official screenshots, which are handsome and intuitive

Pinpoint installation and configuration
Pinpoint installation and configuration
Pinpoint installation and configuration
Pinpoint installation and configuration

Installation and configuration

I installed two CentOS6.8 virtual machines that it used, one to deploy the main program of pinpoint, and one to simulate the test environment. The configuration is as follows:

Pinpoint installation and configuration
java 1.7 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

pinpoint https://github.com/naver/pinpoint

I have integrated all the resources I need and uploaded to Baidu SkyDrive

Baidu SkyDrive : <Link: https://pan.baidu.com/s/1WC3VhyhgicqMMmTgbxMziA Password: vdp6

Install dependencies

Enter the home directory and create a resource directory "pp_res" to store the packages that need to be installed


mkdir /home/pp_res
cd /home/pp_res/

Use xshell and other similar tools to upload the required files to the Linux virtual machine. The main files to be uploaded are all in the Baidu network disk

• jdk7 --- Java runtime environment
• hbase-1.0 --- database, used to store monitoring information
• tomcat8.0 --- Web server
• pinpoint-collector.war --- pp controller
• pinpoint-web.war --- pp display page
•pp-collector.init --- used to quickly start pp-col, not necessary
•pp-web.init --- used to quickly start pp-web, not also possible
Pinpoint installation and configuration

Configure JDK, install hbase

Modify Hbase configuration information


vi hbase-site.xml

    hbase.rootdir
    file:///data/hbase

Start hbase


cd /data/service/hbase/bin
./start-hbase.sh

# 查看Hbase是否启动成功,如果启动成功的会看到"HMaster"的进程
[root@localhost bin]# jps
12075 Jps
11784 HMaster

Initialize Hbase's pinpoint library


# 执行pinpoint提供的Hbase初始化语句,这时会初始化一会。
./hbase shell /home/pp_res/hbase-create.hbase

# 执行完了以后,进入Hbase
./hbase shell

# 进入后可以看到Hbase的版本,还有一些相关的信息
2016-11-15 01:55:44,861 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using built
in-java classes where applicableHBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 1.0.3, rf1e1312f9790a7c40f6a4b5a1bab2ea1dd559890, Tue Jan 19 19:26:53 PST 2016

hbase(main):001:0>

# 输入"status 'detailed'"可以查看刚才初始化的表,是否存在
hbase(main):001:0> status 'detailed'
version 1.0.3
0 regionsInTransition
master coprocessors: []
1 live servers
    localhost:50887 1478538574709
        requestsPerSecond=0.0, numberOfOnlineRegions=498, usedHeapMB=24, maxHeapMB=237, numberOfStores=626, numberOfStorefiles=0, storefileUncom
pressedSizeMB=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=7714, writeRequestsCount=996, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, coprocessors=[MultiRowMutationEndpoint]        "AgentEvent,,1478539104778.aa1b3b14d0b48d83cbf4705b75cb35b7."
            numberOfStores=1, numberOfStorefiles=0, storefileUncompressedSizeMB=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0,
readRequestsCount=0, writeRequestsCount=0, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, completeSequenceId=-1, dataLocality=0.0
...

You can also log in to the web to check whether the HBase data is initialized successfully

HbaseWeb : http://192.168.245.134:16010/master-status
Pinpoint installation and configuration

Install pinpoint-collector

Deploy war package, and then configure quick start


# 配置快速启动需要修改pp-collector.init的路径( pp-collector在网盘里面有 ),可以"vi"进去,大概在18,24,27行处,修改相关的路径。我这边为了方便,直接就用替换的shell做了,如果路径与我的不一致,需要将路径修改成自己的路径。
cd /home/pp_res
sed -i "s/JAVA_HOME=\/usr\/java\/default\//JAVA_HOME=\/usr\/java\/jdk17\//g" pp-collector.init
sed -i "s/CATALINA_HOME=\/data\/service\/pinpoint-collector\//CATALINA_HOME=\/data\/service\/pp-col\//g" pp-collector.init
sed -i "s/CATALINA_BASE=\/data\/service\/pinpoint-collector\//CATALINA_BASE=\/data\/service\/pp-col\//g" pp-collector.init

# 将文件赋予"执行"的权限,把它放到"init.d"中去。以后就可以restart快速重启了。
chmod 711 pp-collector.init
mv pp-collector.init /etc/init.d/pp-col

# 测试一下restart
[root@localhost pp_res]# /etc/init.d/pp-col restart
Stoping Tomcat
Using CATALINA_BASE:   /data/service/pp-col/
Using CATALINA_HOME:   /data/service/pp-col/
Using CATALINA_TMPDIR: /data/service/pp-col//temp
Using JRE_HOME:        /usr/java/jdk17/
Using CLASSPATH:       /data/service/pp-col//bin/bootstrap.jar:/data/service/pp-col//bin/tomcat-juli.jar

waiting for processes to exitStarting tomcat
Using CATALINA_BASE:   /data/service/pp-col/
Using CATALINA_HOME:   /data/service/pp-col/
Using CATALINA_TMPDIR: /data/service/pp-col//temp
Using JRE_HOME:        /usr/java/jdk17/
Using CLASSPATH:       /data/service/pp-col//bin/bootstrap.jar:/data/service/pp-col//bin/tomcat-juli.jar
Tomcat started.
Tomcat is running with pid: 22824

Install pinpoint-web

Deploy war package configuration quick start


# 需要修改"pp-web.init",与上面的步骤一致
cd /home/pp_res
sed -i "s/JAVA_HOME=\/usr\/java\/default\//JAVA_HOME=\/usr\/java\/jdk17\//g" pp-web.init
sed -i "s/CATALINA_HOME=\/data\/service\/pinpoint-web\//CATALINA_HOME=\/data\/service\/pp-web\//g" pp-web.init
sed -i "s/CATALINA_BASE=\/data\/service\/pinpoint-web\//CATALINA_BASE=\/data\/service\/pp-web\//g" pp-web.init

# 将文件赋予"执行"的权限,把让放到"init.d"中去。以后就可以restart快速重启了。
chmod 711 pp-web.init
mv pp-web.init /etc/init.d/pp-web

# 测试一下restart
[root@localhost pp_res]# /etc/init.d/pp-web restart
Stoping Tomcat
Using CATALINA_BASE:   /data/service/pp-web/
Using CATALINA_HOME:   /data/service/pp-web/
Using CATALINA_TMPDIR: /data/service/pp-web//temp
Using JRE_HOME:        /usr/java/jdk17/
Using CLASSPATH:       /data/service/pp-web//bin/bootstrap.jar:/data/service/pp-web//bin/tomcat-juli.jar

waiting for processes to exitStarting tomcat
Using CATALINA_BASE:   /data/service/pp-web/
Using CATALINA_HOME:   /data/service/pp-web/
Using CATALINA_TMPDIR: /data/service/pp-web//temp
Using JRE_HOME:        /usr/java/jdk17/
Using CLASSPATH:       /data/service/pp-web//bin/bootstrap.jar:/data/service/pp-web//bin/tomcat-juli.jar
Tomcat started.
Tomcat is running with pid: 22703

Deploy pp-agent to collect monitoring data

In the test system, deploy pp-agent to collect monitoring data

Deploying the collector is very simple, just add 3 sentences. I do a test Tomcat here to simulate deployment.

First, create a folder to put the packages needed for testing


mkdir /home/pp_test
cd /home/test

Pull the pp-agent needed for the test to the server, configure the simulated Tomcat test environment, configure the pp-agent collector


# 解压pp-agent
cd /home/pp_test
tar -zxvf pinpoint-agent-1.5.2.tar.gz
mv pinpoint-agent-1.5.2 /data/pp-agent

# 编辑配置文件
cd /data/pp-agent/
vi pinpoint.config

# 主要修改IP,只需要指定到安装pp-col的IP就行了,安装pp-col启动后,自动就开启了9994,9995,9996的端口了。这里就不需要操心了,如果有端口需求,要去pp-col的配置文件("pp-col/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties")中,修改这些端口
profiler.collector.ip=192.168.245.136

# 修改测试项目下的tomcat启动文件"catalina.sh",修改这个只要是为了监控测试环境的Tomcat,增加探针
cd /data/pp-test/bin
vi catalina.sh

# 在20行增加如下字段
# 第一行是pp-agent的jar包位置
# 第二行是agent的ID,这个ID是唯一的,我是用pp + 今天的日期命名的,只要与其他的项目的ID不重复就好了
# 第三行是采集项目的名字,这个名字可以随便取,只要各个项目不重复就好了
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/data/pp-agent/pinpoint-bootstrap-1.5.2.jar"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=pp20161122"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=MyTestPP

Started, we can access the test environment
Pinpoint installation and configuration

Guess you like

Origin blog.51cto.com/15065852/2606446