前沿
官方网站: http://naver.github.io/pinpoint/
pinpoint四件套:
- HBase (for storage)
- Pinpoint Collector (deployed on a web container)
- Pinpoint Web (deployed on a web container)
- Pinpoint Agent (attached to a java application for profiling)
安装依赖一览
HBASE的JAVA依赖
Pinpoint Version | HBase 0.94.x | HBase 0.98.x | HBase 1.0.x | HBase 1.1.x | HBase 1.2.x |
---|---|---|---|---|---|
1.0.x | yes | no | no | no | no |
1.1.x | no | not tested | yes | not tested | not tested |
1.5.x | no | not tested | yes | not tested | not tested |
1.6.x | no | not tested | not tested | not tested | yes |
1.7.x | no | not tested | not tested | not tested | yes |
PinPoint的JAVA依赖
Pinpoint Version | Agent | Collector | Web |
---|---|---|---|
1.0.x | 6-8 | 6+ | 6+ |
1.1.x | 6-8 | 7+ | 7+ |
1.5.x | 6-8 | 7+ | 7+ |
1.6.x | 6-8 | 7+ | 7+ |
1.7.x | 6-8 | 8+ | 8+ |
Agent与Collector的依赖关系
Agent Version | Collector 1.0.x | Collector 1.1.x | Collector 1.5.x | Collector 1.6.x | Collector 1.7.x |
---|---|---|---|---|---|
1.0.x | yes | yes | yes | yes | yes |
1.1.x | not tested | yes | yes | yes | yes |
1.5.x | no | no | yes | yes | yes |
1.6.x | no | no | not tested | yes | yes |
1.7.x | no | no | no | no | yes |
安装
安装JAVA
略
HBase安装
首先下载hbase: http://www.apache.org/dyn/closer.cgi/hbase/
开始安装hbase: http://hbase.apache.org/book.html#_introduction
解压后直接执行``bin/start-hbase.sh``。
初始化``./bin/hbase shell /scripts/hbase-create.hbase``。脚本可以在这里下载:https://github.com/naver/pinpoint/tree/1.6.x/hbase/scripts。请注意链接中的版本号。
这里也可以使用压缩的方式初始化``hbase-create-snappy.hbase``。
PinPoint安装
> 这里使用发布的方式安装,也是官方推荐的方式。
下载:https://github.com/naver/pinpoint/releases/tag/1.7.2
安装Collector
将下载的``pinpoint-collector-$VERSION.war``部署到web容器中,例如tomcat。
Collector提供了两个配置文件:``pinpoint-collector.properties``和``hbase.properties``。配置文件位于部署目录的``WEB-INF/classes``。
pinpoint-collector.properties中基本配置:
collector.tcpListenPort
(agent’s profiler.collector.tcp.port - default: 9994)collector.udpStatListenPort
(agent’s profiler.collector.stat.port - default: 9995)collector.udpSpanListenPort
(agent’s profiler.collector.span.port - default: 9996)
hbase.properties中基本配置:
hbase.client.host
(default: localhost)hbase.client.port
(default: 2181)
安装Web
将下载的``pinpoint-collector-$VERSION.war``部署到web容器中,例如tomcat。
Web提供了两个配置文件``pinpoint-web.properties``和``hbase.properties``。配置文件位于部署目录的``WEB_INF/classes``。
hbase.properties基本配置:
hbase.client.host
(default: localhost)hbase.client.port
(default: 2181)
安装Agent
Pinpoint Agent runs as a java agent attached to an application to be profiled (such as Tomcat).
解压pinpoint-agent-1.7.2-SNAPSHOT.tar.gz。(主意,需要制定到一个目录下,否则可能是散的。推荐名:pinpoint-agent)。
如果你想改变输出的日志级别,可以修改``pinpoint-agent/lib/log4j.xml``文件。
应用程序埋点方式:
```
CATALINA_OPTS="$CATALINA_OPTS -javaagent:$AGENT_PATH/pinpoint-bootstrap-$VERSION.jar"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=$AGENT_ID"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=$APPLICATION_NAME"
```
Agent提供了一个配置文件:$AGENT_PATH/pinpoint.config。
需要检查的基础配置:
profiler.collector.ip
(default: 127.0.0.1)profiler.collector.tcp.port
(collector’s collector.tcpListenPort - default: 9994)profiler.collector.stat.port
(collector’s collector.udpStatListenPort - default: 9995)profiler.collector.span.port
(collector’s collector.udpSpanListenPort - default: 9996)
总结
至此简单的pinpoint环境就搭建完毕了。可以访问web的服务来查看效果。
后续再分享集群、调优、通知等功能。