pinpoint the Docker build environment

In the last chapter. "

pinpoint-server, a list of materials

To build a pinpoint-server, following these materials to be ready:

  1. linux operating system, recommended centos6.7;

  2. ssh services to facilitate post-login operation;

  3. jdk1.8, for example: jdk1.8.0_144;

  4. hbase, recommendation 1.2.6;

  5. tomcat, recommend 8.0.36, placed inside ROOT directory pinpoint-collector package;

  6. tomcat, recommend 8.0.36, placed inside ROOT directory pinpoint-web package;

  7. hbase initialization script;

Begin pinpoint-server material

Making the required pinpoint-server I have all the material uploaded to the git, welcome to download, the address is: [email protected]: zq2599 / pinpoint163-server.git

Initially, it was said the following about how to prepare these materials:

About 1,2, have an existing mirrored meet our requirements: kinogmt / centos-ssh: 6.7, the system is centos6.7, integrated service ssh, root account password is password;

About 3, good jdk1.8.0_144 download the installation package when making image files directly to local installation;

About 4, good hbase1.2.6 download the installation package, copy the image file to make time to come;

About 5, the tomcat8.0.36 installation package downloaded from the official website down, after decompression, the decompression pinpoint-collector.war open, to copy the contents inside the webapps / ROOT directory tomcat, in addition to remember to modify tomcat / conf / server. xml in port, for example, to 8080 to 18009 18080,8009;

About 6, and 5 of the same modification method, decompression is pinpoint-web.war, and tomcat ports and 5 do not conflict, and my side is 8080 to 28080;

About 7 to find hbase-create.hbase this file from pinpoint the source code, when copied directly to mirror last on the list;

pinpoint-server mirroring Dockerfile

About Dockerfile image file, as shown below, key positions have added a note, do not say:

# Docker image of pinpoint server	
# VERSION 0.0.1	
# Author: bolingcavalry	
#基础镜像使用kinogmt/centos-ssh:6.7,这里面已经装好了ssh,密码是password	
FROM kinogmt/centos-ssh:6.7	
#作者	
MAINTAINER BolingCavalry <[email protected]>	
#定义工作目录	
ENV WORK_PATH /usr/local/work	
#定义jdk1.8的文件夹	
ENV JDK_PACKAGE_FILE jdk1.8.0_144	
#定义jdk1.8的文件名	
ENV JDK_RPM_FILE jdk-8u144-linux-x64.rpm	
#定义hbase文件名	
ENV HBASE_PACKAGE_NAME hbase-1.2.6	
#定义collector文件夹名	
ENV COLLECTOR_PACKAGE_NAME tomcat-collector	
#定义web文件夹名	
ENV WEB_PACKAGE_NAME tomcat-web	
#定义pinpoint的hbase初始化数据脚本名称	
ENV PINPOINT_HBASE_INIT_DATA_NAME hbase-create.hbase	
#yum更新	
#RUN yum -y update	
#把分割过的jdk1.8安装文件复制到工作目录	
COPY ./jdkrpm-* $WORK_PATH/	
#用本地分割过的文件恢复原有的jdk1.8的安装文件	
RUN cat $WORK_PATH/jdkrpm-* > $WORK_PATH/$JDK_RPM_FILE	
#本地安装jdk1.8,如果不加后面的yum clean all,就会报错:Rpmdb checksum is invalid	
RUN yum -y localinstall $WORK_PATH/$JDK_RPM_FILE; yum clean all	
#把hbase文件夹复制到工作目录	
COPY ./$HBASE_PACKAGE_NAME $WORK_PATH/hbase	
#把collector文件夹复制到工作目录	
COPY ./$COLLECTOR_PACKAGE_NAME $WORK_PATH/$COLLECTOR_PACKAGE_NAME	
#把web文件夹复制到工作目录	
COPY ./$WEB_PACKAGE_NAME $WORK_PATH/$WEB_PACKAGE_NAME	
#把pinpoint的初始化数据文件复制到工作目录	
COPY ./$PINPOINT_HBASE_INIT_DATA_NAME $WORK_PATH/	
#删除jdk分割文件	
RUN rm $WORK_PATH/jdkrpm-*	
#删除jdk安装包文件	
RUN rm $WORK_PATH/$JDK_RPM_FILE	
#赋读权限	
RUN chmod a+r $WORK_PATH/hbase/conf/hbase-env.sh	
#赋读权限	
#RUN chmod a+r $WORK_PATH/hbase/conf/hbase-site.xml	
#配置hostname	
RUN echo HOSTNAME=master>>/etc/sysconfig/network	
#定义环境变量	
ENV JAVA_HOME=/usr/java/$JDK_PACKAGE_FILE/	
ENV HBASE_HOME=$WORK_PATH/hbase/	
ENV PATH=$JAVA_HOME/bin:$HBASE_HOME/bin:$PATH	
EXPOSE 60010	
EXPOSE 18080	
EXPOSE 28080

Execute the following command in the directory where you can build Dockerfile local mirror, all of these materials have placed in this directory:

docker build -t bolingcavalry/centos67-hbase126-pinpoint163-server:0.0.1

pinpoint-agent, material list

  1. linux operating system, no special requirements;

  2. tomcat, for example: 7.0.77;

  3. jdk1.8;

  4. Modify the tomcat-users.xml configuration, add the account information, the tomcat deployment support online applications;

  5. pinpoint-agent包;

  6. tomcat's catalina.sh modify, add pinpoint relevant parameters;

Begin pinpoint-agent material

Making the required pinpoint-agent I have all the material uploaded to the git, welcome to download, the address is: [email protected]: zq2599 / pinpoint163-agent.git

Initially, it was said the following about how to prepare these materials:

About 1,2, tomcat official mirror to meet our requirements: tomcat: 7.0.77-jre8; about 3, good jdk1.8.0_144 download the installation package when making image files directly to local installation; about 4 to prepare a modification good tomcat-user.xml file, mirrored when forced to overwrite the original file with the same name tomcat / conf directory under the can; about 5, the compiled pinpoint-agent folder ready mirrored copy past time can pay attention to the contents of the file to be modified pinpoint.config, profiler.collector.ip corresponds to a value corresponding to pinpoint-server alias link parameter; about 6, to prepare an edited catalina.sh file, to mirror force when to cover same name file in the original tomcat / bin directory can be, and the original catalina.sh compared to an increase of the following:

CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/local/work/pinpoint-agent-1.6.3/pinpoint-bootstrap-1.6.3-SNAPSHOT.jar"	
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.agentId=$PINPOINT_AGENT_ID"	
CATALINA_OPTS="$CATALINA_OPTS -Dpinpoint.applicationName=$PINPOINT_APPLICATION_NAME"

pinpoint-agent mirror Dockerfile

About Dockerfile image file, as shown below, key positions have added a note, do not say:

# docker image for pinpoint agent	
# VERSION 0.0.1	
# Author: bolingcavalry	
#基础镜像	
FROM tomcat:7.0.77-jre8	
#作者	
MAINTAINER BolingCavalry <[email protected]>	
#定义工作目录	
ENV WORK_PATH /usr/local/tomcat/conf	
#定义catalina.sh文件目录	
ENV CATALINA_PATH /usr/local/tomcat/bin	
#定义agent工作目录	
ENV AGENT_WORK_PATH /usr/local/work	
#定义agent文件夹名称	
ENV AGENT_PACKAGE_NAME pinpoint-agent-1.6.3	
#定义要替换的文件名	
ENV USER_CONF_FILE_NAME tomcat-users.xml	
#定义要替换的server.xml文件名	
ENV SERVER_CONF_FILE_NAME server.xml	
#定义要替换的catalina.sh文件名	
ENV CATALINA_FILE_NAME catalina.sh	
#删除原文件tomcat-users.xml	
RUN rm $WORK_PATH/$USER_CONF_FILE_NAME	
#复制文件tomcat-users.xml	
COPY  ./$USER_CONF_FILE_NAME $WORK_PATH/	
#删除原文件server.xml	
RUN rm $WORK_PATH/$SERVER_CONF_FILE_NAME	
#复制文件server.xml	
COPY  ./$SERVER_CONF_FILE_NAME $WORK_PATH/	
#删除原文件catalina.sh	
RUN rm $CATALINA_PATH/$CATALINA_FILE_NAME	
#复制文件catalina.sh	
COPY  ./$CATALINA_FILE_NAME $CATALINA_PATH/	
#创建agent文件所在目录	
RUN mkdir $AGENT_WORK_PATH	
#把collector文件夹复制到工作目录	
COPY ./$AGENT_PACKAGE_NAME $AGENT_WORK_PATH/$AGENT_PACKAGE_NAME

Execute the following command in the directory where you can build Dockerfile local mirror, all of these materials have placed in this directory:

docker build -t bolingcavalry/centos67-pinpoint163-agent:0.0.1

These are the production process pinpoint-sever and pinpoint-agent mirror, the use of such images, combined with the previous chapter "under Docker, speed experience pinpoint1.6.3" configuration and startup, you can easily build a complete pinpoint the environment;

I welcome the attention of the public numbers: programmer Chen Xin

Published 328 original articles · won praise 946 · Views 1.17 million +

Guess you like

Origin blog.csdn.net/boling_cavalry/article/details/101369300