pinpoint installation deployment (1)

pinpoint is an APM monitoring tool on github that is open source and written in Java for large-scale distributed system monitoring.It has the smallest impact on performance (only about 3% increase in resource utilization), and the installation agent is non-intrusive, so you can monitor the entire program by adding 3 sentences to the Tomcat under test and laying a probe.This Blog is meant to record how it was installed for future reference.

I installed two CentOS 6.8 virtual machines it used, a main program that deploys pinpoint, and a simulated test environment.The configuration is as follows:

Preparatory phase
JDK download address:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

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

Or download integrated later (recommended)
Links: http://pan.baidu.com/s/1c2couDM Password: afvb

1. Environment Configuration

1.1 Get the required dependent packages
Go to the home directory and create a "pp_res" resource directory to store the packages you need to install

mkdir /home/pp_res
cd /home/pp_res/

Using similar tools such as xftp, the necessary files are uploaded to the Linux virtual machine. The main files to be uploaded are in pp_res downloaded from Baidu's networking disk.

Explanation:
jdk7 - Java Runtime Environment
hbase-1.0 - Database for storing monitoring information
tomcat8.0 - Web server
Controller for pinpoint-collector.war-pp
pinpoint-web.war-pp presentation page
pp-collector.init - Used to quickly launch pp-col, not also
pp-web.init - Used to quickly launch pp-web, not necessarily

Use the ls or ll command to see if the upload was successful

[root@test2 pp_res]# ll
total 218088
-rw-r--r--. 1 root root   9277365 Jul 17 11:05 apache-tomcat-8.0.36.tar.gz
-rw-r--r--. 1 root root 103847513 Jul 17 11:05 hbase-1.0.3-bin.tar.gz
-rw-r--r--. 1 root root     16984 Jul 17 11:05 hbase-create.hbase
-rw-r--r--. 1 root root   6621915 Jul 17 11:05 pinpoint-agent-1.5.2.tar.gz
-rw-r--r--. 1 root root  31339914 Jul 17 11:05 pinpoint-collector-1.5.2.war
-rw-r--r--. 1 root root  54505168 Jul 17 11:05 pinpoint-web-1.5.2.war
-rw-r--r--. 1 root root  17699306 Jul 17 11:05 zookeeper-3.4.6.tar.gz

1.2 Configuration jdk1.7
This APM system is mainly deployed using jdk1.7. First, configure JDK environment variables

cd /home/pp_res/
tar -zxvf jdk-7u79-linux-x64.tar.gz
mkdir /usr/java
mv jdk1.7.0_79/ /usr/java/jdk17

Configuring java environment variables

vi /etc/profile

Copy the following to the last line of the profile

export JAVA_HOME=/usr/java/jdk17
export PATH=$PATH:$JAVA_HOME/bin

Let environment variables take effect

source /etc/profile

Test if java's environment variables are configured

[root@localhost pp_res]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

2. Install Hbase
The test data collected by pinpoint mainly exists in the Hbase database.So it can collect a large amount of data for more detailed analysis.

1. Unzip Hbase and place it in the specified directory

cd /home/pp_res/
tar -zxvf hbase-1.0.3-bin.tar.gz
mkdir -p /data/service
mv hbase-1.0.3/ /data/service/hbase

2. Modify the JAVA_HOME environment variable location for hbase-env.sh

cd /data/service/hbase/conf/
vi hbase-env.sh

At around line 27, modify as follows

export JAVA_HOME=/usr/java/jdk17/

3. Modify the configuration information of Hbase

vi hbase-site.xml

Modify to the following at the end, where we specify Hbase to store the data locally, and production environments recommend that the data be stored in HDFS.

<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>file:///data/hbase</value>
 </property>
</configuration>

4. Start hbase

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

Check to see if Hbase started successfully and if it did, you'll see the "HMaster" process

[root@localhost bin]# jps
12075 Jps
11784 HMaster

5. Initialize Hbase's pinpoint Library
Execute the Hbase initialization statement provided by pinpoint, which will initialize for a while.

./hbase shell /home/pp_res/hbase-create.hbase

After execution, enter Hbase

./hbase shell

You can see the version of Hbase when you enter, along with some related information

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<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.0.3, rf1e1312f9790a7c40f6a4b5a1bab2ea1dd559890, Tue Jan 19 19:26:53 PST 2016

hbase(main):001:0>

Enter status'detailed'to see if the table you just initialized exists

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 see if the data for HBase has been successfully initialized
HbaseWeb : http://10.244.76.136:16010/master-status

3. Install pinpoint-collector

3.1 Deploy the war package
Unzip Tomcat and move the Tomcat rename to the specified location

cd /home/pp_res/
tar -zxvf apache-tomcat-8.0.36.tar.gz
mv apache-tomcat-8.0.36/ /data/service/pp-col

Modify the configuration of Tomcat for pp-col, mainly modifying the port to avoid port conflicts with Tomcat for pp-web.I've added 1 before the default port, and here's the replacement shell command.

[Note] The last one is to open tomcat's private ip and need to replace the cost machine's ip with localhost. My local network card is the default. If your local network card is not eth0, you need to modify it accordingly.Or go in directly with "vi" and modify the localhost

cd /data/service/pp-col/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
sed -i "s/localhost/`ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | awk -F: '{print $2}'`/g" server.xml

Deploy pinpoint-collector.war package
[Note: If there is no unzip command, you can "yum install unzip"]

cd /home/pp_res/
rm -rf /data/service/pp-col/webapps/*
unzip pinpoint-collector-1.5.2.war -d /data/service/pp-col/webapps/ROOT

Start Tomcat

cd /data/service/pp-col/bin/
./startup.sh

View logs for successful startup

tail -f ../logs/catalina.out

3.2 Configuration Quick Start

Configuring a Quick Start requires modifying the path of pp-collector.init (which is found on your disk), which can be accessed by "vi", at approximately 18, 24, 27 lines, to modify the associated path.For convenience, I did it directly with a replacement shell, and if the path doesn't match mine, I need to modify it to my own path.

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

Give the file execute permission and put it in init.d.You can restart it quickly later.

chmod 711 pp-collector.init
mv pp-collector.init /etc/init.d/pp-col


# Test 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: 1190

Keywords: HBase Java Tomcat xml

Added by joseph on Wed, 12 Jun 2019 20:26:50 +0300