docker版本
https://github.com/naver/pinpoint-docker
docker 基础镜像
docker pull zookeeper:3.4
docker pull flink:1.3.1
docker pull pinpointdocker/pinpoint-web
docker pull pinpointdocker/pinpoint-collector:2.1.0
docker pull pinpointdocker/pinpoint-hbase
docker pull pinpointdocker/pinpoint-agent:2.1.0
docker pull pinpointdocker/pinpoint-mysql:2.1.0
docker pull pinpointdocker/pinpoint-quickstart:latest
注意8000 9997、8080、9994-9996、16010、6123、2181、2888、3888、8081、8079端口不能被占用
安装pinpoint-docker的包
Tags · pinpoint-apm/pinpoint-docker (github.com)
可以安装2.1.0
[root@master ~]# unzip pinpoint-docker-2.0.1.zip
cd pinpoint-docker-2.0.1
vim docker-compose.yml
version: "3.6" 变成 version: "2.2
yum install docker-compose -y
docker-compose
[root@master ~]# cd pinpoint-docker-2.1.0/
[root@master pinpoint-docker-2.1.0]# docker-compose pull
Pulling pinpoint-mysql ... done
Pulling zoo1 ... done
Pulling pinpoint-hbase ... done
Pulling pinpoint-collector ... done
Pulling pinpoint-agent ... done
Pulling pinpoint-quickstart ... done
Pulling pinpoint-web ... done
Pulling zoo2 ... done
Pulling zoo3 ... done
Pulling jobmanager ... done
Pulling taskmanager ... done
[root@master pinpoint-docker-2.1.0]# docker-compose up -d
Creating network "pinpoint-docker-210_pinpoint" with driver "bridge"
Creating volume "pinpoint-docker-210_data-volume" with default driver
Creating volume "pinpoint-docker-210_mysql_data" with default driver
Creating pinpoint-docker-210_zoo2_1 ... done
Creating pinpoint-docker-210_zoo1_1 ... done
Creating pinpoint-docker-210_zoo3_1 ... done
Creating pinpoint-mysql ... done
Creating pinpoint-flink-jobmanager ... done
Creating pinpoint-hbase ... done
Creating pinpoint-flink-taskmanager ... done
Creating pinpoint-collector ... done
Creating pinpoint-web ... done
Creating pinpoint-agent ... done
Creating pinpoint-quickstart ... done
1、pinpoint-web
[root@pinpoint pinpoint-docker-2.0.1]# docker ps | grep pinpoint
192.168.10.140:8079
2、flink
192.168.10.140:8081
3、quickstart
192.168.10.140:8000
4、hbase
http://192.168.10.140:16010
5、pinpoint-agent
https://github.com/pinpoint-apm/pinpoint-docker/releases/tag/2.0.1
war
192.168.10.141
tar zxvf pinpoint-agent-2.0.1.tar.gz
cd /root/pinpoint/profiles/local
vim pinpoint-env.config
修改ip地址为140
cd /root/pinpoint/profiles/release
vim pinpoint-env.config
修改ip地址为140
1、将tomcat放在 /opt下
2、解压tomcat
3、mv apache-tomcat-8.5.47 tomcat8
4、cd pinpoint-agent/
5、将JSP的war包放在该目录下
6、mv JSP-1.0-SNAPSHOT.war /opt/tomcat8/webapps
打开github的官网
7、cd /opt/tomcat8/bin
[root@pinpoint-agent bin]# vim catalina.sh
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/root/pinpoint-agent/pinpoint/pinpoint-bootstrap-2.0.1.jar"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=dockeragent0629"
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=springMvcDemo141"
[root@pinpoint-agent bin] ./startup.sh
检测tomcat是否启动
查看war包情况
[root@pinpoint-agent webapps]# ll 可以看到JSP已经解压缩完成
total 712
drwxr-x--- 15 root root 4096 Jun 28 19:07 docs
drwxr-x--- 6 root root 83 Jun 28 19:07 examples
drwxr-x--- 5 root root 87 Jun 28 19:07 host-manager
drwxr-x--- 4 root root 37 Jun 28 19:28 JSP-1.0-SNAPSHOT
-rw-r--r-- 1 root root 724021 Jun 26 23:00 JSP-1.0-SNAPSHOT.war
drwxr-x--- 5 root root 103 Jun 28 19:07 manager
drwxr-x--- 3 root root 283 Jun 28 19:07 ROOT
访问该war包,但该war包毫无作用,所以应该是404
192.168.10.141:8080/JSP-1.0-SNAPSHOT 切记不可8082(坑)
刷新pinpoint
===============================================================================================================================
jar包
192.168.10.143
1、tar zxvf pinpoint-agent-2.0.1.tar.gz
cd /root/pinpoint/profiles/local
vim pinpoint-env.config
修改ip地址为140
cd /root/pinpoint/profiles/release
vim pinpoint-env.config
修改ip地址为140
2、将jar包放在pinpoint下即可
[root@worker2 pinpoint-agent-jar]# java -javaagent:/root/pinpoint-agent-jar/pinpoint/pinpoint-bootstrap.jar -Dpinpoint.agentId=dockerjar0629 -Dpinpoint.applicationNamee=springBootdemo1 -jar Helloworld-1.0-SNAPSHOT.jar (该jar包名称必须可行有效是springboot的项目)
刷新pinpoint-web页面,即出现相关的页面
6、docker–pinpoint支持容器化部署
将dockerfile和jar包放在同一个目录
1、tar zxvf pinpoint-agent-2.0.1.tar.gz
cd /root/pinpoint/profiles/local
vim pinpoint-env.config
修改ip地址为140
cd /root/pinpoint/profiles/release
vim pinpoint-env.config
修改ip地址为140
在pinpoint目录下创建
vim Dockerfile
FROM openjdk:8-alpine3.9
#作者信息
MAINTAINER mjh Docker pinpoint springboot
#安装需要的软件,解决时区问题
RUN apk --update add curl bash tzdata && \
rm -rf /var/cache/apk/*
#修改镜像为东八区时间
ENV TZ Asia/Shanghai
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} /app.jar
COPY pinpoint/ /root/pinpoint-agent-jar/pinpoint
EXPOSE 8081
ENTRYPOINT java -javaagent:/root/pinpoint-agent-jar/pinpoint/pinpoint-bootstrap-2.0.1.jar -Dpinpoint.agentId=dockeragent062901 -Dpinpoint.applicationName=springboot062901 -jar /app.jar
docker build --rm -t docker/test:1.0 --build-arg JAR_FILE=jar有效包名称 .
docker run -itd --name pinpointdemo1 -p 8081:8081 docker/test:1.0
docker logs -f pinpointdemo1