1 System environment
- Ubuntu 16.04 LTS
- hbase-1.2.6-bin.tar.gz(http://hbase.apache.org/)
- hbase-create.hbase(https://github.com/naver/pinpoint/tree/master/hbase/scripts)
- pinpoint-collector-1.7.2.war(https://github.com/naver/pinpoint/releases/tag/1.7.2)
- pinpoint-web-1.7.2.war(https://github.com/naver/pinpoint/releases/tag/1.7.2)
- pinpoint-agent-1.7.2.tar.gz(https://github.com/naver/pinpoint/releases/tag/1.7.2)
- apache-tomcat-8.5.24.tar.gz (for deployment)
2. Deployment process
Upload the required resources to the server and ensure that the Java environment has been installed
2.1 Install Hbase
1. Unzip the hbase tar package
tar -zxvf hbase-1.2.6-bin.tar.gz
2. Modify the JAVA_HOME environment variable address of hbase-env.sh
export JAVA_HOME=/opt/apps/jdk/jdk1.8.0_131/
3. Modify the hbase-site.xml configuration file
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///opt/apps/pinpoint/hbase-1.2.6/data</value>
</property>
</configuration>
4. Start hbase
./start-hbase.sh
5. Check whether Hbase is successfully started
jps
root@VM-0-15-ubuntu:/opt/apps/pinpoint/hbase-1.2.6/bin# jps
7652 HMaster
2277 Elasticsearch
14839 Main
7994 Jps
The existence of the Hmaster process indicates that the startup was successful
6. Initialize the pinpoint library of Hbase
./hbase shell /opt/apps/pinpoint/hbase-create.hbase
root@VM-0-15-ubuntu:/opt/apps/pinpoint/hbase-1.2.6/bin# ./hbase shell /opt/apps/pinpoint/hbase-create.hbase
2018-04-27 11:29:35,228 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
0 row(s) in 1.8260 seconds
0 row(s) in 4.2500 seconds
0 row(s) in 4.2420 seconds
0 row(s) in 1.2260 seconds
0 row(s) in 1.2180 seconds
0 row(s) in 1.2170 seconds
0 row(s) in 1.2210 seconds
0 row(s) in 2.2250 seconds
0 row(s) in 1.2250 seconds
0 row(s) in 8.2820 seconds
0 row(s) in 1.2220 seconds
0 row(s) in 2.2210 seconds
0 row(s) in 1.2250 seconds
0 row(s) in 1.2150 seconds
0 row(s) in 1.2150 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) in 0.1490 seconds
7. The initialization is completed and enter Hbase
./hbase shell
root@VM-0-15-ubuntu:/opt/apps/pinpoint/hbase-1.2.6/bin# ./hbase shell
2018-04-27 11:31:47,222 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
Check if the current initialization table exists
hbase(main):001:0> status ‘detailed’
Or log in to Hbase web to check whether the table is initialized successfully, and the browser accesses http://XXXX:16010/master-status
2.2 Install Pinpoint Collector
1. Create a directory pinpoint-collector, unzip tomcat to this directory
mkdir pinpoint-collector
tar -zxvf apache-tomcat-8.5.24.tar.gz -C ./pinpoint-collector/
2. Because pinpoint-collector and pinpoint-web are installed on the same machine here, we need to ensure that the ports will not conflict, and modify the tomcat server.xml file
<Server port="18005" shutdown="SHUTDOWN">
<Connector port="18080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="18443" />
<!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />-->
3. Deploy pinpoint-collector-1.7.2.war to tomcat and name it ROOT
rm -rf ./pinpoint-collector/apache-tomcat-8.5.24/webapps/*
unzip pinpoint-collector-1.7.2.war -d ./pinpoint-collector/apache-tomcat-8.5.24/webapps/ROOT/
4.修改hbase.properties(./pinpoint-collector/apache-tomcat-8.5.24/webapps/ROOT/WEB-INF/classes/ hbase.properties)
# 修改hbase地址,本机默认即可
hbase.client.host=localhost
hbase.client.port=2181
2.3 Install Pinpoint Web
1. Create a directory pinpoint-web, decompress tomcat to this directory
mkdir pinpoint-web
tar -zxvf apache-tomcat-8.5.24.tar.gz -C pinpoint-web/
2. Modify the tomcat server.xml file
<Server port="28005" shutdown="SHUTDOWN">
<Connector port="28080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="28443" />
<!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />-->
3. Deploy pinpoint-web-1.7.2.war to tomcat and name it ROOT
rm -rf ./pinpoint-web/apache-tomcat-8.5.24/webapps/*
unzip pinpoint-web-1.7.2.war -d ./pinpoint-web/apache-tomcat-8.5.24/webapps/ROOT/
4.修改hbase.properties(./pinpoint-web/apache-tomcat-8.5.24/webapps/ROOT/WEB-INF/classes/hbase.properties)
# 修改hbase地址,本机默认即可
hbase.client.host=localhost
hbase.client.port=2181
5. Start pinpoint-collector and pinpoint-web services
./pinpoint-collector/apache-tomcat-8.5.24/bin/startup.sh
./pinpoint-web/apache-tomcat-8.5.24/bin/startup.sh
Check the tomcat log to see if the service starts successfully
tail -f ./pinpoint-collector/apache-tomcat-8.5.24/logs/catalina.out
tail -f ./pinpoint-web/apache-tomcat-8.5.24/logs/catalina.out
Browser access: http://XXXX:28080 indicates that the service was started successfully
2.4 Install Pinpoint Agent
1. Create a directory pinpoint-agent and extract pinpoint-agent to this directory
tar -zxvf pinpoint-agent-1.7.2.tar.gz -C ./pinpoint-agent/
2. Modify the configuration file pinpoint.config
# 修改为pinpoint-collector地址,本机可不配置
profiler.collector.ip=127.0.0.1
3. There are two ways to add probes
- Modify the tomcat startup file catalina.sh of the deployment project, add probes, and restart tomcat
# 设置pinpoint-agent jar包位置
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/apps/pinpoint/pinpoint-agent/pinpoint-bootstrap-1.7.2.jar"
# 设置agent的ID
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=pp20180428"
# 设置采集项目的名称,不能与其它项目重复
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=demo-app"
- Spring Boot start
java -javaagent:/opt/apps/pinpoint/pinpoint-agent/pinpoint-bootstrap-1.7.2.jar -Dpinpoint.agentId=pp-springboot -Dpinpoint.applicationName=springboot-app -jar spring-boot-demo-0.0.1-SNAPSHOT.jar
After the Spring Boot method is used here, access the test interface http://XXXX:8080/hello
Select the sampling point on the right to view the details
3 References
http://naver.github.io/pinpoint/installation.html#quick-overview-of-installation
http://iamlile.github.io/2017/10/06/apm/
https://blog.csdn.net/xiaozhuanddapang/article/details/75554807