官方網站: 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的JAVA依賴
Agent與Collector的依賴關係
安裝
安裝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的服務來查看效果。
---------------------
作者:noryar_
來源:CSDN
原文:https://blog.csdn.net/lee272616/article/details/79804979
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!