One 、Pinpoint Brief introduction
Pinpoint Is a Yes Java Write a large-scale distributed system APM Tools , Some people also like to call this kind of tool call chain system 、 Distributed tracking system . Generally speaking , The front end sends a query request to the back end , Background services may call multiple services , Each service may call other services , Finally return the result to , Put it on the page . If something goes wrong , It's hard for engineers to pinpoint exactly which service invocation caused this problem ,Pinpoint And other related tools are used to track the complete call link of each request , Collect performance data for each service on the call link , It is convenient for engineers to locate problems quickly .Pinpoint Open source is in github On , Can be used for large-scale distributed system monitoring . It has the least impact on performance ( Just add about 3% Resource utilization ), install agent It's noninvasive , It just needs to be tested Tomcat Medium plus 3 Sentence , Drop the probe , You can monitor the whole program .

Two 、Pinpoint Reason for use
The most important reason , Zero intrusion into code , Application JavaAgent Bytecode enhancement technology , Just add the startup parameters .

install pinpoint Components that need to be used :Oracle JDK、HBase Storage 、Pinpoint Collector、Pinpoint Web 、Pinpoint Agent (attached Performance analysis of the last application server )、Tomcat.
Pinpoint Architecture diagram

Pinpoint It provides a solution , By tracking transactions in distributed applications, it helps to analyze the overall structure of the system and the relationship between the components in them :
-  Pinpoint-Collector: Collect all kinds of performance data .
-  Pinpoint-Agent: A probe associated with an application running on its own .
-  Pinpoint-Web: Display the collected data as WEB Web form .
-  HBase Storage: The collected data is stored in HBase in .

Be similar to Pinpoint There are similar tools for twitter Of Zipkin、 Taobao's Eagle eye (EgleEye)、 Public comment CAT、Google Of Dapper.

3、 ... and 、Pinpoint stay Centos6.9 Installation and configuration records under the system

1) Based on the environment

IP Host name Installation items describe
192.168.10.205 pinpoint-server pinpoint,Hbase,zookeeper pinpoint Of web Display end , Logic controller , as well as Hbase Storage
192.168.10.206 pinpont-clinet pinpoint-agent It's mainly used to collect data , Send to pinpoint End treatment
The following operations are performed on both servers :
[root@pinpoint-server ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@pinpoint-server ~]# /etc/init.d/iptables stop
[root@pinpoint-server ~]# setenforce 0
setenforce: SELinux is disabled
[root@pinpoint-server ~]# getenforce
Disabled
[root@pinpoint-server ~]# cat /etc/sysconfig/selinux |grep "SELINUX=disabled"
SELINUX=disabled
install java8
Download address :https://pan.baidu.com/s/1pLaAjPp
Extract password :x27s
Uninstall the default java("rpm -qa|grep java", Find out , Use rpm -e To uninstall .
[root@pinpoint-server ~]# cd /usr/local/src/
[root@pinpoint-server src]# ll jdk-8u131-linux-x64_.rpm
-rw-r--r--. 1 root root 169983496 Nov 19 2017 jdk-8u131-linux-x64_.rpm
[root@pinpoint-server src]# rpm -ivh jdk-8u131-linux-x64_.rpm
[root@pinpoint-server src]# vim /etc/profile
......
JAVA_HOME=/usr/java/jdk1.8.0_131
JAVA_BIN=/usr/java/jdk1.8.0_131/bin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/sbin/
CLASSPATH=.:/lib/dt.jar:/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
[root@pinpoint-server src]# source /etc/profile
[root@pinpoint-server src]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

2) install zookeeper( stay 192.168.10.205, namely pinpoint-server End installation )

 We need to pay attention to : If Hbase Not with pinpoint(pinpoint-collector and pinpoint-web) On a machine , Need to install zookeeper.
In this test case ,zookeeper、hbase and pinpoint(pinpoint-collector and pinpoint-web) All installed on one server .
Download and install zookeeper Before , To install java Environmental Science
[root@pinpoint-server ~]# cd /usr/local/src/
[root@pinpoint-server src]# wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz
[root@pinpoint-server src]# tar -zvxf zookeeper-3.4.10.tar.gz -C /data/
[root@pinpoint-server src]# cd /data/zookeeper-3.4.10/
[root@pinpoint-server zookeeper-3.4.10]# mkdir data
[root@pinpoint-server zookeeper-3.4.10]# mkdir logs
[root@pinpoint-server zookeeper-3.4.10]# cd conf
[root@pinpoint-server conf]# cp zoo_sample.cfg zoo.cfg
[root@pinpoint-server conf]# cat zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper-3.4.10/data
dataLogDir=/data/zookeeper-3.4.10/logs
clientPort=2181
server.1=192.168.10.205:2888:3888
among :
2888 The port number is zookeeper The port of communication between services .
3888 yes zookeeper Port to communicate with other applications .
And then in /data/zookeeper-3.4.10/data Create under directory myid file ( edit myid file , And in the corresponding IP Enter the corresponding number on your machine .
If in zookeeper On ,myid The content of the document is 1. If you only install and configure on a single point , So there's only one server.1)
[root@pinpoint-server conf]# echo "1" > /data/zookeeper-3.4.10/data/myid
Modify the system environment variables under the current user
[root@pinpoint-server conf]# vim /etc/profile
......
ZOOKEEPER_HOME=/hdata/zookeeper-3.4.10
PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
[root@pinpoint-server conf]# source /etc/profile
[root@pinpoint-server conf]# echo $ZOOKEEPER_HOME
/hdata/zookeeper-3.4.10
start-up zookeeper service ( If after starting , Find out 2181 The port is not in , Start failed , You can see zookeeper.out Analyze the cause of startup failure )
[root@pinpoint-server conf]# cd /data/zookeeper-3.4.10/bin
[root@pinpoint-server bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /data/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@pinpoint-server bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /data/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: standalone
[root@pinpoint-server bin]# lsof -i:2181
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 23059 root 23u IPv6 251073 0t0 TCP *:eforward (LISTEN)
see zookeeper The process after startup ( Use jps Command is enough )
[root@pinpoint-server bin]# jps
23059 QuorumPeerMain
23149 Jps
zookeeper Service output information
[root@pinpoint-server bin]# tail -500f zookeeper.out
stop it zookeeper service
[root@pinpoint-server bin]# ./zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /data/zookeeper-3.4.10/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
[root@pinpoint-server bin]# lsof -i:2181
[root@pinpoint-server bin]# jps
23246 Jps
Set up zookeeper Boot up
[root@pinpoint-server bin]# cd /etc/rc.d/init.d
[root@pinpoint-server init.d]# touch zookeeper
[root@pinpoint-server init.d]# chmod +x zookeeper
[root@pinpoint-server init.d]# vim zookeeper
#!/bin/bash
#chkconfig:2345 20 90
#description:zookeeper
#processname:zookeeper
export JAVA_HOME=/usr/java/jdk1.8.0_131
export PATH=$JAVA_HOME/bin:$PATH
case $1 in
start)su root /data/zookeeper-3.4.10/bin/zkServer.sh start;;
stop)su root /data/zookeeper-3.4.10/bin/zkServer.sh stop;;
status)su root /data/zookeeper-3.4.10/bin/zkServer.sh status;;
restart)su root /data/zookeeper-3.4.10/bin/zkServer.sh restart;;
*) echo "require start|stop|status|restart" ;;
esac
And then you can use it /etc/init.d/zookeeper start/restart/stop To start up / restart / close zookeeper Yes
[root@pinpoint-server init.d]# /etc/init.d/zookeeper start
ZooKeeper JMX enabled by default
Using config: /data/zookeeper-3.4.10/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@pinpoint-server init.d]# service zookeeper status
ZooKeeper JMX enabled by default
Using config: /data/zookeeper-3.4.10/bin/../conf/zoo.cfg
Mode: standalone
[root@pinpoint-server init.d]# lsof -i:2181
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 23432 root 23u IPv6 251180 0t0 TCP *:eforward (LISTEN)
[root@pinpoint-server init.d]# jps
23458 Jps
23432 QuorumPeerMain
hold zookeeper Add to boot up
[root@pinpoint-server init.d]# chkconfig zookeeper on
[root@pinpoint-server init.d]# chkconfig --list|grep zookeeper
zookeeper 0:off 1:off 2:on 3:on 4:on 5:on 6:off

3) install Hbase( stay 192.168.10.205, namely pinpoint-server End installation )

pinpoint Test data collected , It's mainly the existence of Hbase Database . So it can collect a lot of data , More detailed analysis can be carried out .
Installation configuration Hbase
[root@root@pinpoint-server ~]# cd /usr/local/src/
[root@root@pinpoint-server src]# curl -OL http://files.saas.hand-china.com/hitoa/1.0.0/hbase-1.2.4-bin.tar.gz
[root@root@pinpoint-server src]# tar -zvxf hbase-1.2.4-bin.tar.gz
[root@root@pinpoint-server src]# mv hbase-1.2.4 /data/
stay /etc/profile Add the following at the end of the file , Set up hbase The system environment variable of
[root@root@pinpoint-server src]# vim /etc/profile
.......
export HBASE_HOME=/data/hbase-1.2.4
[root@root@pinpoint-server ~]# source /etc/profile
[root@root@pinpoint-server ~]# echo $HBASE_HOME
/data/hbase-1.2.4
To configure HBase The configuration file
[root@root@pinpoint-server ~]# cd /data/hbase-1.2.4/conf/
[root@root@pinpoint-server conf]# cp hbase-site.xml hbase-site.xml.bak
stay hbase-site.xml To add the following :
At the end, change it to the following , Here I specify Hbase Store data locally , The production environment stores data suggestions in HDFS in .( Modify the corresponding parameters )
[root@root@pinpoint-server conf]# vim hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:/data/hbase-1.2.4/data</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.regionserver.handler.count</name>
<value>20</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>localhost</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>200000</value>
</property>
</configuration>
reminder :
HBase Support HDFS Storage , But you need to install Hadoop And so on , This is just for convenience , Not for the time being HDFS. in addition , The production environment suggests HBase colony , For the time being, only HBase A single node .
modify hbase-env.sh, The following settings , It means to make HBase Don't use built-in Zookeeper, And using the external device installed in the front Zookeeper
[root@root@pinpoint-server conf]# vim hbase-env.sh
.......
export HBASE_MANAGES_ZK=false
start-up HBase(HBase The log file is located in /data/hbase-1.2.4/logs , You can see HBase start log .)
[root@root@pinpoint-server conf]# cd /data/hbase-1.2.4/bin/
[root@root@pinpoint-server bin]# ./start-hbase.sh
starting master, logging to /data/hbase-1.2.4/logs/hbase-root-master-root@pinpoint-server.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
starting regionserver, logging to /data/hbase-1.2.4/logs/hbase-root-1-regionserver-root@pinpoint-server.out
see hbase The process started
[root@root@pinpoint-server bin]# ps -ef|grep hbase
It can be used jps Command view Hbase Startup successful , If the startup succeeds, you will see ”HMaster” The process of
[root@root@pinpoint-server bin]# jps
24465 Jps
24146 HRegionServer
23432 QuorumPeerMain
24057 HMaster
see hbase Service port for
[root@root@pinpoint-server bin]# lsof -i:16010
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 24057 root 171u IPv6 252331 0t0 TCP *:16010 (LISTEN)
Type in the browser http://192.168.10.239:16010/master-status To visit hbase Of web page
===============hbase Possible problems with startup =================
1)hbase Use after startup jps Command to see if hmaster process
modify hbase-site.xml Of documents "export HBASE_MANAGES_ZK=false"
The cluster configuration is false, Stand alone is true, It is amended as follows true After that
2) Successfully started HBase, But it's not accessible in the browser http://ip:16010, This is because the firewall is turned on by default , You can turn off the firewall before trying to access . 

Then proceed Pinpoint Initialization of table structure

Pinpoint use HBase As underlying storage , You need to be in HBase Initialize the table structure in .
hbase-1.2.4-bin.tar.gz and pinpoint-hbase-create.hbase Download address :https://pan.baidu.com/s/16Eyhep01nxhkEgjTDOya9Q
Extract password :5ga9
First, make sure HBase It's a normal startup state
[root@root@pinpoint-server ~]# jps|grep HMaster
24057 HMaster
[root@root@pinpoint-server ~]# lsof -i:16010
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 24057 root 171u IPv6 252331 0t0 TCP *:16010 (LISTEN)
And so on Hbase Initialization operation
[root@root@pinpoint-server ~]# cd /data/
[root@root@pinpoint-server data]# curl -OL http://files.saas.hand-china.com/hitoa/1.0.0/pinpoint-hbase-create.hbase
[root@root@pinpoint-server data]# cd /data/hbase-1.2.4/bin/
[root@root@pinpoint-server bin]# ./hbase shell /data/pinpoint-hbase-create.hbase
......
......
0 row(s) in 1.2310 seconds
0 row(s) in 1.2150 seconds
0 row(s) in 1.2150 seconds
TABLE
AgentEvent
AgentInfo
AgentLifeCycle
AgentStat
AgentStatV2
ApiMetaData
ApplicationIndex
ApplicationMapStatisticsCallee_Ver2
ApplicationMapStatisticsCaller_Ver2
ApplicationMapStatisticsSelf_Ver2
ApplicationTraceIndex
HostApplicationMap_Ver2
SqlMetaData_Ver2
StringMetaData
TraceV2
Traces
16 row(s) in 0.0340 seconds
As can be seen above ,Hbase After the database is initialized successfully , Will be in HBase Created in 16 A watch .
=======================================================================================
reminder :Hbase During initialization , The following problems may arise :
There is a problem ,zookeeper Unconnected :client.ConnectionManager$HConnectionImplementation: Can’t get connection to ZooKeeper: KeeperErrorCode =
ConnectionLoss for /hbase
=======================================================================================
Access page HbaseWeb:http://192.168.10.239:16010/master-status If successful in the tables The imported table can be seen under the tag .

4) install Pinpoint( stay 192.168.10.205, namely pinpoint-server End installation )

 Install separately Pinpoint Collector and Pinpoint Web, Deployment of both requires tomcat Environmental Science .
Download separately apache-tomcat-8.5.31.tar.gz、pinpoint-agent-1.7.3.tar.gz、pinpoint-collector-1.7.3.war、pinpoint-web-1.7.3.war Four bags ,
Put it in /usr/local/src Under the table of contents .
Download address :https://pan.baidu.com/s/1wpEy09ISkKEkN2ufAd9gtQ
Extract password :b9pu

4.1) Install first pinpoint-collector

[root@pinpoint-server ~]# cd /usr/local/src/
[root@pinpoint-server src]# ll apache-tomcat-8.5.33.tar.gz
-rw-rw-r-- 1 root root 9621331 Aug 21 16:57 apache-tomcat-8.5.33.tar.gz
[root@pinpoint-server src]# tar -zvxf apache-tomcat-8.5.33.tar.gz
[root@pinpoint-server src]# mkdir -p /data/pinpoint
[root@pinpoint-server src]# mv apache-tomcat-8.5.33 /data/pinpoint/pp-col
[root@pinpoint-server src]# ls /data/pinpoint/pp-col
bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps work
modify pp-col Of Tomcat Configuration of , Main modification port , Avoid and pp-web Of Tomcat Port conflict for . I added... Before the original default port 1, Here is the replacement shell command .
reminder :
The last one is to tomcat Private ownership of ip to open up , Need to put localhost Replace the cost machine ip, My local network card is the default , If the local network card is not eth0, Relevant modifications are needed .
Or use it directly "vi" go in , modify localhost
[root@pinpoint-server src]# cd /data/pinpoint/pp-col/conf/
[root@pinpoint-server conf]# sed -i 's/port="8005"/port="18005"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/port="8080"/port="18080"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/port="8443"/port="18443"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/port="8009"/port="18009"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/redirectPort="8443"/redirectPort="18443"/g' server.xml
[root@pinpoint-server conf]# sed -i "s/localhost/`ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | awk -F: '{print $2}'`/g" server.xml
Deploy pinpoint-collector.war package
[root@pinpoint-server conf]# ll /usr/local/src/pinpoint-collector-1.7.3.war
-rw-rw-r-- 1 root root 48343632 Aug 21 18:03 /usr/local/src/pinpoint-collector-1.7.3.war
[root@pinpoint-server conf]# rm -rf /data/pinpoint/pp-col/webapps/*
[root@pinpoint-server conf]# mv /usr/local/src/pinpoint-collector-1.7.3.war /data/pinpoint/pp-col/webapps/
[root@pinpoint-server conf]# ll /data/pinpoint/pp-col/webapps/
total 47212
-rw-rw-r-- 1 root root 48343632 Aug 21 18:03 pinpoint-collector-1.7.3.war
[root@pinpoint-server conf]# cd /data/pinpoint/pp-col/webapps/
[root@pinpoint-server webapps]# ls
pinpoint-collector-1.7.3.war
[root@pinpoint-server webapps]# unzip pinpoint-collector-1.7.3.war -d /data/pinpoint/pp-col/webapps/ROOT
[root@pinpoint-server webapps]# ls
pinpoint-collector-1.7.3.war ROOT
start-up Tomcat
[root@pinpoint-server webapps]# cd /data/pinpoint/pp-col/bin/
[root@pinpoint-server bin]# ./startup.sh
Check the log , Start successfully or not
[root@pinpoint-server bin]# tail -f /data/pinpoint/pp-col/logs/catalina.out
[root@pinpoint-server bin]# ps -ef|grep tomcat
root 31043 1 21 08:13 pts/2 00:00:08 /usr/java/jdk1.8.0_131/bin/java -Djava.util.logging.config.file=/data/pinpoint/pp-col/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /data/pinpoint/pp-col/bin/bootstrap.jar:/data/pinpoint/pp-col/bin/tomcat-juli.jar -Dcatalina.base=/data/pinpoint/pp-col -Dcatalina.home=/data/pinpoint/pp-col -Djava.io.tmpdir=/data/pinpoint/pp-col/temp org.apache.catalina.startup.Bootstrap start
root 31228 28329 0 08:14 pts/2 00:00:00 grep tomcat
[root@pinpoint-server bin]# lsof -i:18080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 31043 root 49u IPv6 50719842 0t0 TCP *:18080 (LISTEN)
Configure quick start , Startup file pp-collector.init Download address :https://pan.baidu.com/s/1frjko9C5N84-SkqD-AQsGg Extract password :4syp
Download to /usr/local/src Under the table of contents
[root@pinpoint-server ~]# cd /usr/local/src/
[root@pinpoint-server src]# ll pp-collector.init
-rwxr-xr-x 1 root root 3066 Aug 22 13:21 pp-collector.init
[root@pinpoint-server src]# vim pp-collector.init # Mainly modify the following three lines , Modify the path according to the actual environment
......
export JAVA_HOME=/usr/java/jdk1.8.0_131
......
export CATALINA_HOME=/data/pinpoint/pp-col/
......
export CATALINA_BASE=/data/pinpoint/pp-col/
Give the document to " perform " Authority , Put it in "init.d" In the middle . In the future restart Fast restart .
[root@pinpoint-server src]# chmod 755 pp-collector.init
[root@pinpoint-server src]# mv pp-collector.init /etc/init.d/pp-col
Test it restart
[root@pinpoint-server src]# /etc/init.d/pp-col restart
Stoping Tomcat
Using CATALINA_BASE: /data/pinpoint/pp-col/
Using CATALINA_HOME: /data/pinpoint/pp-col/
Using CATALINA_TMPDIR: /data/pinpoint/pp-col//temp
Using JRE_HOME: /usr/java/jdk1.8.0_131
Using CLASSPATH: /data/pinpoint/pp-col//bin/bootstrap.jar:/data/pinpoint/pp-col//bin/tomcat-juli.jar
waiting for processes to exitStarting tomcat
Using CATALINA_BASE: /data/pinpoint/pp-col/
Using CATALINA_HOME: /data/pinpoint/pp-col/
Using CATALINA_TMPDIR: /data/pinpoint/pp-col//temp
Using JRE_HOME: /usr/java/jdk1.8.0_131
Using CLASSPATH: /data/pinpoint/pp-col//bin/bootstrap.jar:/data/pinpoint/pp-col//bin/tomcat-juli.jar
Tomcat started.
Tomcat is running with pid: 11469
[root@pinpoint-server src]# /etc/init.d/pp-col status
Tomcat is running with pid: 11469

4.2) Then install pinpoint-web

 Deploy war package
decompression Tomcat, take Tomcat Rename move to specified location
[root@pinpoint-server ~]# cd /usr/local/src/
[root@pinpoint-server src]# ll apache-tomcat-8.5.33.tar.gz
-rw-rw-r-- 1 root root 9621331 Aug 21 16:57 apache-tomcat-8.5.33.tar.gz
[root@pinpoint-server src]# tar -zvxf apache-tomcat-8.5.33.tar.gz
[root@pinpoint-server src]# mv apache-tomcat-8.5.33 /data/pinpoint/pp-web
[root@pinpoint-server src]# ll /data/pinpoint
total 8
drwxr-xr-x 9 root root 4096 Aug 22 08:05 pp-col
drwxr-xr-x 9 root root 4096 Aug 22 13:30 pp-web
modify pp-web Of Tomcat Configuration of , Main modification port , Avoid and pp-col Of Tomcat Port conflict for . I added... Before the original default port 2, Here is the replacement shell command
reminder :
The last one is to tomcat Private ownership of ip to open up , Need to put localhost Replace the cost machine ip, My local network card is the default , If your local network card is not eth0, Relevant modifications are needed .
Or use it directly "vi" go in , modify localhost
[root@pinpoint-server src]# cd /data/pinpoint/pp-web/conf/
[root@pinpoint-server conf]# sed -i 's/port="8005"/port="28005"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/port="8080"/port="28080"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/port="8443"/port="28443"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/port="8009"/port="28009"/g' server.xml
[root@pinpoint-server conf]# sed -i 's/redirectPort="8443"/redirectPort="28443"/g' server.xml
[root@pinpoint-server conf]# sed -i "s/localhost/`ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | awk -F: '{print $2}'`/g" server.xml
Deploy pinpoint-collector.war package
[root@pinpoint-server conf]# ll /usr/local/src/pinpoint-web-1.7.3.war
-rw-rw-r-- 1 root root 78999706 Aug 21 18:02 /usr/local/src/pinpoint-web-1.7.3.war
[root@pinpoint-server conf]# rm -rf /data/pinpoint/pp-web/webapps/*
[root@pinpoint-server conf]# mv /usr/local/src/pinpoint-web-1.7.3.war /data/pinpoint/pp-web/webapps/
[root@pinpoint-server conf]# cd /data/pinpoint/pp-web/webapps/
[root@pinpoint-server webapps]# ll
total 77156
-rw-rw-r-- 1 root root 78999706 Aug 21 18:02 pinpoint-web-1.7.3.war
[root@pinpoint-server webapps]# unzip pinpoint-web-1.7.3.war -d /data/pinpoint/pp-web/webapps/ROOT
[root@pinpoint-server webapps]# ls
pinpoint-web-1.7.3.war ROOT
see war Is the package decompressed successfully
[root@pinpoint-server webapps]# ll /data/pinpoint/pp-web/webapps/ROOT/WEB-INF/classes/
total 96
-rw-r--r-- 1 root root 907 May 3 15:20 applicationContext-cache.xml
-rw-r--r-- 1 root root 3684 May 3 15:20 applicationContext-dao-config.xml
-rw-r--r-- 1 root root 2820 May 3 15:20 applicationContext-datasource.xml
-rw-r--r-- 1 root root 8472 May 3 15:20 applicationContext-hbase.xml
-rw-r--r-- 1 root root 495 May 3 15:20 applicationContext-web-namespace.xml
-rw-r--r-- 1 root root 969 May 3 15:20 applicationContext-websocket.xml
-rw-r--r-- 1 root root 10629 May 3 15:20 applicationContext-web.xml
drwxr-xr-x 2 root root 4096 May 3 15:20 batch
-rw-r--r-- 1 root root 149 May 3 15:20 batch.properties
drwxr-xr-x 3 root root 4096 May 3 15:20 com
-rw-r--r-- 1 root root 697 May 3 15:20 ehcache.xml
-rw-r--r-- 1 root root 1159 May 3 15:20 hbase.properties
-rw-r--r-- 1 root root 158 May 3 15:20 jdbc.properties
-rw-r--r-- 1 root root 3286 May 3 15:20 log4j.xml
drwxr-xr-x 2 root root 4096 May 3 15:21 mapper
-rw-r--r-- 1 root root 1600 May 3 15:20 mybatis-config.xml
-rw-r--r-- 1 root root 3690 May 3 15:20 pinpoint-web.properties
-rw-r--r-- 1 root root 160 May 3 15:20 project.properties
-rw-r--r-- 1 root root 2478 May 3 15:20 servlet-context.xml
drwxr-xr-x 2 root root 4096 May 3 15:21 sql
There's a little bit of clarification here :
- hbase.properties Configure us pp-web From which data source to collect data , Here we only specify Hbase Of zookeeper Address .
- jdbc.properties pp-web Connect yourself Mysql Connection authentication configuration of database .
- sql Catalog pp-web Some of its data needs to be stored in MySQL In the database , Here we need to initialize the table structure .
- pinpoint-web.properties here pp-web Configuration files for the cluster , If you need pp-web Word of the cluster .
- applicationContext-* .xml These files will be used in the subsequent tuning work .
- log4j.xml Log related configuration .
start-up Tomcat
[root@pinpoint-server webapps]# cd /data/pinpoint/pp-web/bin/
[root@pinpoint-server bin]# ./startup.sh
Using CATALINA_BASE: /data/pinpoint/pp-web
Using CATALINA_HOME: /data/pinpoint/pp-web
Using CATALINA_TMPDIR: /data/pinpoint/pp-web/temp
Using JRE_HOME: /usr/java/jdk1.8.0_131
Using CLASSPATH: /data/pinpoint/pp-web/bin/bootstrap.jar:/data/pinpoint/pp-web/bin/tomcat-juli.jar
Tomcat started.
Check the log ,Tocmat Startup successful ( The following is pp-col and pp-web The two that started tomcat process )
[root@pinpoint-server bin]# ps -ef|grep tomcat
root 11469 1 6 13:27 pts/0 00:00:42 /usr/java/jdk1.8.0_131/bin/java -Djava.util.logging.config.file=/data/pinpoint/pp-col//conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /data/pinpoint/pp-col//bin/bootstrap.jar:/data/pinpoint/pp-col//bin/tomcat-juli.jar -Dcatalina.base=/data/pinpoint/pp-col/ -Dcatalina.home=/data/pinpoint/pp-col/ -Djava.io.tmpdir=/data/pinpoint/pp-col//temp org.apache.catalina.startup.Bootstrap start
root 14733 1 99 13:38 pts/0 00:01:03 /usr/java/jdk1.8.0_131/bin/java -Djava.util.logging.config.file=/data/pinpoint/pp-web/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /data/pinpoint/pp-web/bin/bootstrap.jar:/data/pinpoint/pp-web/bin/tomcat-juli.jar -Dcatalina.base=/data/pinpoint/pp-web -Dcatalina.home=/data/pinpoint/pp-web -Djava.io.tmpdir=/data/pinpoint/pp-web/temp org.apache.catalina.startup.Bootstrap start
root 15176 6951 0 13:39 pts/0 00:00:00 grep tomcat
[root@pinpoint-server bin]# tail -f /data/pinpoint/pp-web/logs/catalina.out
[root@pinpoint-server bin]# lsof -i:28080 #28080 yes pp-web Service port for
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 14733 root 49u IPv6 576300 0t0 TCP *:28080 (LISTEN)
[root@pinpoint-server bin]# lsof -i:18080 #18080 yes pp-col Service port for
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 11469 root 49u IPv6 556976
Configure quick start , Startup file pp-web.init Download address :https://pan.baidu.com/s/17d4oQZG60iWC_JlhnNHgUw Extract password :787p
Download to /usr/local/src Under the table of contents
[root@pinpoint-server ~]# cd /usr/local/src/
[root@pinpoint-server src]# ll pp-web.init
-rw-rw-r-- 1 root root 3067 Aug 22 13:42 pp-web.init
[root@pinpoint-server src]# vim pp-web.init # Mainly modify the following three lines , Modify the path according to the actual environment
export JAVA_HOME=/usr/java/jdk1.8.0_131/
.......
export CATALINA_HOME=/data/pinpoint/pp-web/
.......
export CATALINA_BASE=/data/pinpoint/pp-web/
Give the document to " perform " Authority , Put it in "init.d" In the middle . In the future restart Fast restart .
[root@pinpoint-server src]# chmod 755 pp-web.init
[root@pinpoint-server src]# mv pp-web.init /etc/init.d/pp-web
Test it restart
[root@pinpoint-server src]# /etc/init.d/pp-web restart
Stoping Tomcat
Using CATALINA_BASE: /data/pinpoint/pp-web/
Using CATALINA_HOME: /data/pinpoint/pp-web/
Using CATALINA_TMPDIR: /data/pinpoint/pp-web//temp
Using JRE_HOME: /usr/java/jdk1.8.0_131/
Using CLASSPATH: /data/pinpoint/pp-web//bin/bootstrap.jar:/data/pinpoint/pp-web//bin/tomcat-juli.jar
waiting for processes to exitStarting tomcat
Using CATALINA_BASE: /data/pinpoint/pp-web/
Using CATALINA_HOME: /data/pinpoint/pp-web/
Using CATALINA_TMPDIR: /data/pinpoint/pp-web//temp
Using JRE_HOME: /usr/java/jdk1.8.0_131/
Using CLASSPATH: /data/pinpoint/pp-web//bin/bootstrap.jar:/data/pinpoint/pp-web//bin/tomcat-juli.jar
Tomcat started.
Tomcat is running with pid: 16914
[root@pinpoint-server src]# /etc/init.d/pp-web status
Tomcat is running with pid: 16914
You can visit this address at this time , Enter... In the browser "http://192.168.10.205:28080", The main page will appear 

5) Deploy pp-agent Collect monitoring data ( stay 192.168.10.206, namely pinpoint-client End installation )

 Deploying the collector is simple , You just need to add 3 Just a word . as follows , Do a test Tomcat, Use pinpoint-web-1.7.3.war Package to simulate deployment .
[root@pinpoint-client ~]# mkdir -p /data/pinpoint/pp-test
take tomcat Installation package 、pinpoint-agent package 、pinpoint-web Of war Put the package in this directory :
[root@pinpoint-client ~]# ll /data/pinpoint/pp-test/
total 95248
-rw-rw-r--. 1 root root 9621331 Aug 21 16:57 apache-tomcat-8.5.33.tar.gz
-rw-rw-r--. 1 root root 8906297 Aug 21 17:59 pinpoint-agent-1.7.3.tar.gz
-rw-rw-r--. 1 root root 78999706 Aug 21 18:02 pinpoint-web-1.7.3.war
Configured simulated Tomcat Test environment
[root@pinpoint-client ~]# cd /data/pinpoint/pp-test/
[root@pinpoint-client pp-test]# tar -zvxf apache-tomcat-8.5.33.tar.gz
[root@pinpoint-client pp-test]# ls
apache-tomcat-8.5.33 apache-tomcat-8.5.33.tar.gz pinpoint-agent-1.7.3.tar.gz pinpoint-web-1.7.3.war
To configure localhost Let the outside have access to
[root@pinpoint-client pp-test]# cd /data/pinpoint/pp-test/apache-tomcat-8.5.33/conf/
[root@pinpoint-client conf]# sed -i "s/localhost/`ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | awk -F: '{print $2}'`/g" server.xml
For decompression test war package
[root@pinpoint-client conf]# rm -rf /data/pinpoint/pp-test/apache-tomcat-8.5.33/webapps/*
[root@pinpoint-client conf]# mv /data/pinpoint/pp-test/pinpoint-web-1.7.3.war /data/pinpoint/pp-test/apache-tomcat-8.5.33/webapps/
[root@pinpoint-client conf]# cd /data/pinpoint/pp-test/apache-tomcat-8.5.33/webapps/
[root@pinpoint-client webapps]# ll
total 77152
-rw-rw-r--. 1 root root 78999706 Aug 21 18:02 pinpoint-web-1.7.3.war
[root@pinpoint-client webapps]# unzip pinpoint-web-1.7.3.war -d /data/pinpoint/pp-test/apache-tomcat-8.5.33/webapps/ROOT
[root@pinpoint-client webapps]# ll
total 77156
-rw-rw-r--. 1 root root 78999706 Aug 21 18:02 pinpoint-web-1.7.3.war
drwxr-xr-x. 13 root root 4096 Aug 22 22:00 ROOT
To configure pp-agent collector
[root@pinpoint-client webapps]# cd /data/pinpoint/pp-test/
[root@pinpoint-client pp-test]# ll pinpoint-agent-1.7.3.tar.gz
-rw-rw-r--. 1 root root 8906297 Aug 21 17:59 pinpoint-agent-1.7.3.tar.gz
[root@pinpoint-client pp-test]# mkdir -p /data/pinpoint/pp-agent
[root@pinpoint-client pp-test]# tar -zvxf pinpoint-agent-1.7.3.tar.gz -C /data/pinpoint/pp-agent/
[root@pinpoint-client pp-test]# ll /data/pinpoint/pp-agent/
total 108
drwxr-xr-x. 2 root root 4096 Aug 22 22:02 boot
drwxr-xr-x. 2 root root 4096 Aug 22 22:02 lib
-rw-r--r--. 1 root root 33848 May 3 14:17 pinpoint-bootstrap-1.7.3.jar
-rw-r--r--. 1 root root 28450 May 3 12:37 pinpoint.config
-rw-r--r--. 1 root root 24424 May 3 12:37 pinpoint-real-env-lowoverhead-sample.config
drwxr-xr-x. 2 root root 4096 Aug 22 22:02 plugin
drwxr-xr-x. 2 root root 4096 Nov 23 2016 script
drwxr-xr-x. 2 root root 4096 Aug 22 22:02 tools
Edit profile
[root@pinpoint-client pp-test]# cd /data/pinpoint/pp-agent/
[root@pinpoint-client pp-agent]# cp pinpoint.config pinpoint.config.bak
Major changes IP, Just specify to install pp-col Of IP That's it , install pp-col After starting , It turns on automatically 9994,9995,9996 The port of .
There's no need to worry about it , If there are port requirements , Want to go pp-col Configuration file for ("pp-col/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties") in , Modify these ports
[root@pinpoint-client pp-agent]# vim pinpoint.config
......
profiler.collector.ip=192.168.10.205
Modify the tomcat Startup file "catalina.sh", Modify this to monitor the test environment Tomcat, Add probe
[root@pinpoint-client bin]# ll /data/pinpoint/pp-agent/pinpoint-bootstrap-1.7.3.jar #pp-agent Of jar Bag location
-rw-r--r--. 1 root root 33848 May 3 14:17 /data/pinpoint/pp-agent/pinpoint-bootstrap-1.7.3.jar
[root@pinpoint-client pp-agent]# cd /data/pinpoint/pp-test/apache-tomcat-8.5.33/bin/
[root@pinpoint-client bin]# cp catalina.sh catalina.sh.bak
[root@pinpoint-client bin]# vim catalina.sh # stay 20 Add the following fields to the line
......
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/data/pinpoint/pp-agent/pinpoint-bootstrap-1.7.3.jar"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=pp20180221"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=MyTestPP"
among :
The first line is pp-agent Of jar Bag location
The second line is agent Of ID, This ID Is the only one. , I use pp + Today's date is named , Just... With other projects ID Just don't repeat
The third line is the name of the collection project , This name can be taken at will , As long as the items are not repeated
All of the above are configured , You can start monitoring Tomcat 了 , To start the test Tomcat Server for
[root@pinpoint-client bin]# cd /data/pinpoint/pp-test/apache-tomcat-8.5.33/bin/
[root@pinpoint-client bin]# ./startup.sh
Using CATALINA_BASE: /data/pinpoint/pp-test/apache-tomcat-8.5.33
Using CATALINA_HOME: /data/pinpoint/pp-test/apache-tomcat-8.5.33
Using CATALINA_TMPDIR: /data/pinpoint/pp-test/apache-tomcat-8.5.33/temp
Using JRE_HOME: /usr/java/jdk1.8.0_131
Using CLASSPATH: /data/pinpoint/pp-test/apache-tomcat-8.5.33/bin/bootstrap.jar:/data/pinpoint/pp-test/apache-tomcat-8.5.33/bin/tomcat-juli.jar
Tomcat started.
View startup log , exactly Tomcat start-up
[root@pinpoint-client bin]# ps -ef|grep tomcat
root 13566 1 99 22:09 pts/1 00:00:33 /usr/java/jdk1.8.0_131/bin/java -Djava.util.logging.config.file=/data/pinpoint/pp-test/apache-tomcat-8.5.33/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -javaagent:/data/pinpoint/pp-agent/pinpoint-bootstrap-1.7.3.jar -Dpinpoint.agentId=pp20180221 -Dpinpoint.applicationName=MyTestPP -Dignore.endorsed.dirs= -classpath /data/pinpoint/pp-test/apache-tomcat-8.5.33/bin/bootstrap.jar:/data/pinpoint/pp-test/apache-tomcat-8.5.33/bin/tomcat-juli.jar -Dcatalina.base=/data/pinpoint/pp-test/apache-tomcat-8.5.33 -Dcatalina.home=/data/pinpoint/pp-test/apache-tomcat-8.5.33 -Djava.io.tmpdir=/data/pinpoint/pp-test/apache-tomcat-8.5.33/temp org.apache.catalina.startup.Bootstrap start
root 13707 13339 0 22:10 pts/1 00:00:00 grep tomcat
[root@pinpoint-client bin]# lsof -i:8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 13566 root 136u IPv6 154353 0t0 TCP *:webcache (LISTEN)

At this time we will visit pp-web, You can find it in the drop-down box , One more. app

Because I visited three times pp-test Of tomcat page , So it shows that there are 3 Request records , You can view the details in the box in the upper right corner .
Particular attention : Click the arrow position in the upper right corner of the mouse , Hold down the left mouse button , Pull the box to see ( You need to pull the frame to the last line on the right or close to it , Hold down the left key , A new monitoring and Analysis page will appear )

This brings up a new page , You can see , I visited the home page once , I visited test Of servlet. And the details are recorded in the table below .

Come here ,Pinpoint Even if the environment is temporarily deployed , Based on the above operation , To sum up :
1) If Hbase Not with pp-web, pp-col On a machine , Need to install zookeeper, Just install it , exactly 2181 Just start the port .
2) If zookeeper Mounted on a stand-alone machine , It needs to be modified here pp-colletor and pp-web Configuration file for pinpoint-collector.properties,pinpoint-web.properties, Otherwise, the two modules fail to start .

Centos Next distributed tracking tool Pinpoint More articles about the full deployment record of

  1. CentOS Next performance monitoring tool dstat

    Link to the original text :http://www.bkjia.com/Linuxjc/935113.html Reference link :https://linux.cn/article-3215-1.html,http://lhfli ...

  2. [ turn ]CentOS Next performance monitoring tool dstat

    Link to the original text :http://www.bkjia.com/Linuxjc/935113.html Reference link :https://linux.cn/article-3215-1.html,http://lhfli ...

  3. CentOS Next long time ping Network time stamp and record to text

    Linux Next long time ping Network time stamp and record to text   For some reason , For example, we need to check whether there are switching problems between networks , Go for a long time ping An address , Because it will output a lot of information, and it's better to have a timestamp , So we can use simple ...

  4. centos Lower installation mulval Tools

    What I'm using here is centos 6.5 Version system MulVAL It's a tool for enterprise network security analysis . It uses vulnerability scanners (OVAL / Nessus) As the number source of attack path generation , It includes scan results and network accessibility information . before this ...

  5. Centos Get off the fortress Jumpserver V3.0 A complete record of environmental deployment (1)- Installation chapter

    Because the source is unknown . Unauthorized operation . Password leaks . Data stolen . Illegal operation and other factors may make the operating business system face a serious threat , In the event of an accident , If you can't quickly locate the cause of the accident , The operation and maintenance personnel will often take the blame . Several common scenes of operation and maintenance personnel carrying the black pot :1) from ...

  6. Centos Next configuration unit testing tool gtest

    gtest yes google Provides a very powerful unit testing tool , Download address :https://code.google.com/p/googletest I downloaded it gtest-1.6.0. copy to Centos On the system ...

  7. Centos Get off the fortress Jumpserver V3.0 A complete record of environmental deployment (2)- Configuration article

    I've already introduced Jumpserver V3.0 Installation , Based on this installation document , Say below Jumpserver After the installation of the function to use : One .jumpserver Start of Jumpserver Start and restart [root@t ...

  8. centos Next performance analysis tool perf Installation and simple use of

    1. install : cat /etc/redhat-releaseCentOS release 6.6 (Final) sudo yum install perf 2.

  9. centos Next synchronization backup tool rsync Installation and configuration of

    http://www.cnblogs.com/wander1129/archive/2013/03/27/2984922.html

Random recommendation

  1. use Python Write a simple Web frame

    One . summary Two . from demo_app Start 3、 ... and .WSGI Medium application Four . distinguish URL 5、 ... and . restructure 1. Regular matching URL 2.DRY 3. Abstract out the frame 6、 ... and . Reference resources One . summary stay Python in ,WSGI( ...

  2. Mybatis Insert null Value error

    resolvent : 1. stay settings Middle configuration <setting name="jdbcTypeForNull" value="OTHER"/> MyBat ...

  3. Class Realization IDisposing Method

    public class MyResourceHog : IDisposable  {   //  Tags that have been processed    private bool _alreadyDisposed = false;  ...

  4. C# Custom redraw TabControl

    using System.Drawing; using System.Windows.Forms; using System.Drawing.Drawing2D; using System.Runti ...

  5. Shell Take the time format method from

    Shell Take the time format method from 2007-09-13 15:35 Commonly used date The display format of : date +%F //2007-03-06date +%Y%m%d//20070306 date +%T //23: ...

  6. Let's dream CMS The background editor supports Youku Video

    Recently, I made some video tutorials and sent them to Youku website , But I want to introduce these video tutorials to my website , When I published it, I found that dream weaving CMS Its own editor doesn't directly support the reference of Youku and other video websites . So to facilitate the release of the tutorial , Specially in the website search to this tutorial , Explain in detail, such as ...

  7. jQuery plug-in unit

    1. Lightbox 2:    Lightbox 2 Is a cool image display plug-in , The image can be displayed in a new window with smooth expansion , And at the same time, the rest of the page has a black background . Use this plug-in , It's for when your picture is too big, you have to ...

  8. hibernate HQL Inquire about 2.2

    hql( It's all done in a transaction )session.beginTransaction();session.getTransaction().commit(); session.beginTransaction( ...

  9. hdu1054 Minimum vertex cover

    Minimum fixed-point coverage refers to such a situation : chart G The vertex covering of is a set of vertices V, bring G Every edge in the world touches V At least one vertex in . We call it a set V covers G The edge of . Minimum vertex covering is to cover all edges with the least number of vertices . The number of vertex covers is the minimum vertex cover ...

  10. GIT-windows System deployment git The server

    windows System deployment git The server Use it because you need it IIS(Internet Information Service ) To build . To enter the body : Whatever you are win7.win8.win8.1 still w ...