1. docker-compose方式部署
官网传送门: pinpoint-docker
个人传送门: 增加volume持久化
[root@ceshi-132 docker-commpose]# git clone git@gitee.com:liujiangxu/docker-commpose.git
[root@ceshi-132 docker-commpose]# cd pinpoint/docker-pinpoint/
[root@ceshi-132 docker-pinpoint]# docker-compose pull && docker-compose up -d
访问方式http://$ip:8080即可
2. agent配置与采集
web页面给出了agent安装地址,直接下载上传被采集端即可
[root@zabbix ~]# tar -xf pinpoint-agent-2.3.3.tar.gz
[root@zabbix ~]# mv pinpoint-agent-2.3.3 /usr/local/pinpoint-agent
[root@zabbix ~]# cd /usr/local/pinpoint-agent
修改地址为服务端地址
[root@zabbix pinpoint-agent]# sed -i 's/127.0.0.1/10.1.133.97/g' pinpoint-root.config
[root@zabbix pinpoint-agent]# sed -i 's/127.0.0.1/10.1.133.97/g' profiles/local/pinpoint.config
[root@zabbix pinpoint-agent]# sed -i 's/127.0.0.1/10.1.133.97/g' profiles/release/pinpoint.config
(1) tomcat接入
[root@ceshi-132 ~]# vi /usr/local/tomcat/bin/catalina.sh
添加:
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/local/pinpoint-agent/pinpoint-bootstrap-2.3.3.jar"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=his" #agentId必须是唯一的
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=gxzsc-his" #applicationName也是唯一的
(2) jar接入
[root@ceshi-132 ~]# java -jar \
-javaagent:/usr/local/pinpoint-agent/pinpoint-bootstrap-2.3.3.jar \
-Dpinpoint.agentId=his \
-Dpinpoint.applicationName=zsc-his his.jar
运行后可以清晰看到应用整个交互调用拓扑图
拖动红框空可以显示出调用详情(如下有不同的功能)
Inspector可以查看程序jvm指标信息
3. 历史数据清理
#进入hbase容器
[root@zabbix default]# docker exec -it pinpoint-hbase bash
#进入程序目录
root@7646486525f2:/# cd /opt/hbase/hbase-1.2.6/bin
#启动hbase
root@7646486525f2:/opt/hbase/hbase-1.2.6/bin# ./hbase shell
#查看表结构默认ttl为60
hbase(main):001:0> desc 'TraceV2'
Table TraceV2 is ENABLED
TraceV2
COLUMN FAMILIES DESCRIPTION
{NAME => 'S', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'PREFIX', TTL => '5184000 SECONDS (60 DAYS)', COMPRESSION => 'NONE',
MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}
1 row(s) in 0.5140 seconds
#停用表
hbase(main):002:0> disable 'TraceV2'
0 row(s) in 4.3060 seconds
#设置ttl时间为10天
hbase(main):003:0> alter 'TraceV2',{NAME => 'S', TTL => '1296000'}
Updating all regions with the new schema...
256/256 regions updated.
Done.
0 row(s) in 2.2120 seconds
#启用表
hbase(main):002:0> enable 'TraceV2'
0 row(s) in 4.2640 seconds
#清理表数据
hbase(main):003:0> major_compact('TraceV2')
0 row(s) in 0.3190 seconds