4 Commits
Author SHA1 Message Date
Dawid Malinowski 483f93f5ed Clean curl 2015-10-05 21:17:25 +02:00
Dawid Malinowski 36c659a70f Merge branch 'master' into 1.1.1 2015-10-05 21:15:08 +02:00
Dawid Malinowski 74bed065bf Update Dockerfile 2015-10-05 20:59:04 +02:00
Dawid Malinowski 915df2db5e Bump hbase to 1.0.2 2015-09-09 14:05:27 +01:00
18 changed files with 389 additions and 279 deletions
-54
View File
@@ -1,55 +1 @@
# docker-pinpoint
This repo contains the docker images for [Pinpoint](https://github.com/naver/pinpoint), or you can just use the docker compose file run pinpoint in seconds.
### To build the images
* Go to a folder
* `docker build -t repo-name:latest .` to build the image
### To run all containers
```
docker-compose up -d
```
Open your browser and then go to <http://localhost:28080>
### Add your own Java based application to be monitored.
* Modify the `pinpoint.config` if you need.
```
###########################################################
# Collector server #
###########################################################
profiler.collector.ip=127.0.0.1
# placeHolder support "${key}"
profiler.collector.span.ip=${profiler.collector.ip}
profiler.collector.span.port=9996
# placeHolder support "${key}"
profiler.collector.stat.ip=${profiler.collector.ip}
profiler.collector.stat.port=9995
# placeHolder support "${key}"
profiler.collector.tcp.ip=${profiler.collector.ip}
profiler.collector.tcp.port=9994
```
* The following script is a example for a spring boot application.
```shell
java -javaagent:/some-absolute-path/pinpoint-agent-1.6.1/pinpoint-bootstrap-1.6.1.jar -Dpinpoint.agentId=some-union-id -Dpinpoint.applicationName=some-name -jar build/libs/wise-log-1.0.0-SNAPSHOT.jar
```
You can find more samples at: <https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples>
If you plan to use external volumes for hbase you should fill hbase first.
Please run this script inside hbase container
```
${HBASE_HOME}/bin/hbase shell /opt/hbase/hbase-create.hbase; ${HBASE_HOME}/bin/stop-hbase.sh
```
-22
View File
@@ -1,22 +0,0 @@
rancher-server:
image: rancher/server:v1.3.0
restart: unless-stopped
volumes_from:
- pinpoint-agent
ports:
- 8080:8080
environment:
JAVA_OPTS: "-javaagent:/assets/pinpoint-agent/pinpoint-bootstrap-1.6.1.jar -Dpinpoint.agentId=app-in-docker -Dpinpoint.applicationName=app"
pinpoint-agent:
image: wahyd4/pinpoint-agent:1.6.1
net: "none"
restart: unless-stopped
# volumes:
# - /var/container_data/pinpoint-agent/log:/opt/app/pinpoint-agent/log:rw
environment:
COLLECTOR_IP: 192.168.99.100
COLLECTOR_TCP_PORT: 9994
COLLECTOR_UDP_STAT_LISTEN_PORT: 9995
COLLECTOR_UDP_SPAN_LISTEN_PORT: 9996
DISABLE_DEBUG: 'true'
-69
View File
@@ -1,69 +0,0 @@
pinpoint-hbase:
container_name: pinpoint-hbase
hostname: hbase
image: wahyd4/pinpoint-hbase:1.6.1
restart: always
expose:
- "2181"
- "16010"
ports:
- "2181:2181"
- "16010:16010"
pinpoint-collector:
container_name: pinpoint-collector
hostname: collector
image: wahyd4/pinpoint-collector:1.6.1
restart: always
expose:
- "9994"
- "9995"
- "9996"
ports:
- "9994:9994"
- "9995:9995/tcp"
- "9996:9996/tcp"
- "9995:9995/udp"
- "9996:9996/udp"
environment:
HBASE_HOST: hbase
HBASE_PORT: 2181
COLLECTOR_TCP_PORT: 9994
COLLECTOR_UDP_STAT_LISTEN_PORT: 9995
COLLECTOR_UDP_SPAN_LISTEN_PORT: 9996
CLUSTER_ENABLE: 'false'
DISABLE_DEBUG: 'true'
links:
- pinpoint-hbase:hbase
pinpoint-web:
container_name: pinpoint-web
hostname: web
image: wahyd4/pinpoint-web:1.6.1
restart: always
expose:
- "8080"
ports:
- "28080:8080"
environment:
HBASE_HOST: hbase
HBASE_PORT: 2181
CLUSTER_ENABLE: 'false'
ADMIN_PASSWORD: admin123
DISABLE_DEBUG: 'true'
links:
- pinpoint-hbase:hbase
# only example
#pinpoint-agent:
# image: wahyd4/pinpoint-agent:1.6.1
# net: "none"
# restart: unless-stopped
# volumes:
# - /var/container_data/pinpoint-agent/log:/opt/app/pinpoint-agent/log:rw
# environment:
# COLLECTOR_IP: 192.168.99.100
# COLLECTOR_TCP_PORT: 9994
# COLLECTOR_UDP_STAT_LISTEN_PORT: 9995
# COLLECTOR_UDP_SPAN_LISTEN_PORT: 9996
# DISABLE_DEBUG: 'true'
+11 -12
View File
@@ -2,24 +2,23 @@
# TO_BUILD docker build -t pinpoint-agent .
# TO_RUN docker run --name=pinpoint-agent pinpoint-agent
FROM alpine:3.5
FROM alpine:3.2
ENV PINPOINT_VERSION=1.6.1
ENV PINPOINT_VERSION 1.1.1
ADD configure-agent.sh /usr/local/bin/
RUN apk add --update curl bash
RUN apk add --update curl bash \
&& chmod a+x /usr/local/bin/configure-agent.sh \
&& mkdir -p /assets/pinpoint-agent \
&& curl -SL https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/agent/src/main/resources/pinpoint.config -o /assets/pinpoint.config \
&& curl -SL https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-agent-$PINPOINT_VERSION.tar.gz -o pinpoint-agent-$PINPOINT_VERSION.tar.gz \
RUN mkdir -p /opt/app \
&& curl -L -O -k "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-agent-$PINPOINT_VERSION.tar.gz" -o pinpoint-agent.tar.gz \
&& gunzip pinpoint-agent-$PINPOINT_VERSION.tar.gz \
&& tar -xf pinpoint-agent-$PINPOINT_VERSION.tar -C /assets/pinpoint-agent \
&& sed -i 's/DEBUG/INFO/' /assets/pinpoint-agent/lib/log4j.xml \
&& tar -xf pinpoint-agent-$PINPOINT_VERSION.tar -C /opt/app \
&& rm pinpoint-agent-$PINPOINT_VERSION.tar \
&& apk del curl \
&& rm /var/cache/apk/*
VOLUME ["/assets/pinpoint-agent"]
ADD configure.sh /configure.sh
RUN chmod a+x /configure.sh
ENTRYPOINT ["/usr/local/bin/configure-agent.sh"]
VOLUME /opt/app/pinpoint-agent
CMD ["/configure.sh"]
-22
View File
@@ -1,22 +0,0 @@
#!/bin/bash
set -e
set -x
COLLECTOR_IP=${COLLECTOR_IP:-127.0.0.1}
COLLECTOR_TCP_PORT=${COLLECTOR_TCP_PORT:-9994}
COLLECTOR_UDP_STAT_LISTEN_PORT=${COLLECTOR_UDP_STAT_LISTEN_PORT:-9995}
COLLECTOR_UDP_SPAN_LISTEN_PORT=${COLLECTOR_UDP_SPAN_LISTEN_PORT:-9996}
DISABLE_DEBUG=${DISABLE_DEBUG:-true}
cp -f /assets/pinpoint.config /assets/pinpoint-agent/pinpoint.config
sed -i "s/profiler.collector.ip=127.0.0.1/profiler.collector.ip=${COLLECTOR_IP}/g" /assets/pinpoint-agent/pinpoint.config
sed -i "s/profiler.collector.tcp.port=9994/profiler.collector.tcp.port=${COLLECTOR_TCP_PORT}/g" /assets/pinpoint-agent/pinpoint.config
sed -i "s/profiler.collector.stat.port=9995/profiler.collector.stat.port=${COLLECTOR_UDP_STAT_LISTEN_PORT}/g" /assets/pinpoint-agent/pinpoint.config
sed -i "s/profiler.collector.span.port=9996/profiler.collector.span.port=${COLLECTOR_UDP_SPAN_LISTEN_PORT}/g" /assets/pinpoint-agent/pinpoint.config
if [ "$DISABLE_DEBUG" == "true" ]; then
sed -i 's/level value="DEBUG"/level value="INFO"/' /assets/lib/log4j.xml
fi
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -e
set -x
COLLECTOR_IP=${COLLECTOR_IP:-}
sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip='"${COLLECTOR_IP}"'/' /opt/app/pinpoint-agent/pinpoint.config
+209
View File
@@ -0,0 +1,209 @@
#
# Pinpoint agent configuration
#
###########################################################
# Collector server #
###########################################################
profiler.collector.ip=collector
# placeHolder support "${key}"
profiler.collector.span.ip=${profiler.collector.ip}
profiler.collector.span.port=9996
# placeHolder support "${key}"
profiler.collector.stat.ip=${profiler.collector.ip}
profiler.collector.stat.port=9995
# placeHolder support "${key}"
profiler.collector.tcp.ip=${profiler.collector.ip}
profiler.collector.tcp.port=9994
###########################################################
# Profiler Global Configuration #
###########################################################
profiler.enable=true
profiler.jvm.collect.interval=1000
profiler.sampling.enable=true
# Set sampling rate. If you set it to 10, 1 out of 10 transaction will be sampled.
profiler.sampling.rate=1
profiler.io.buffering.enable=true
profiler.io.buffering.buffersize=20
profiler.spandatasender.write.queue.size=5120
#profiler.spandatasender.socket.sendbuffersize=1048576
#profiler.spandatasender.socket.timeout=3000
profiler.spandatasender.chunk.size=16384
profiler.statdatasender.write.queue.size=5120
#profiler.statdatasender.socket.sendbuffersize=1048576
#profiler.statdatasender.socket.timeout=3000
profiler.statdatasender.chunk.size=16384
profiler.agentInfo.send.retry.interval=300000
# Allows TCP data command
profiler.tcpdatasender.command.accept.enable=true
###########################################################
# application type #
###########################################################
#profiler.applicationservertype=TOMCAT
#profiler.applicationservertype=BLOC
###########################################################
# user defined classes #
###########################################################
profiler.include=
###########################################################
# TOMCAT #
###########################################################
profiler.tomcat.hidepinpointheader=true
profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html
###########################################################
# JDBC #
###########################################################
profiler.jdbc=true
profiler.jdbc.sqlcachesize=1024
profiler.jdbc.maxsqlbindvaluesize=1024
#
# MYSQL
#
profiler.jdbc.mysql=true
profiler.jdbc.mysql.setautocommit=true
profiler.jdbc.mysql.commit=true
profiler.jdbc.mysql.rollback=true
#
# MSSQL Jtds
#
profiler.jdbc.jtds=true
profiler.jdbc.jtds.setautocommit=true
profiler.jdbc.jtds.commit=true
profiler.jdbc.jtds.rollback=true
#
# Oracle
#
profiler.jdbc.oracle=true
profiler.jdbc.oracle.setautocommit=true
profiler.jdbc.oracle.commit=true
profiler.jdbc.oracle.rollback=true
#
# CUBRID
#
profiler.jdbc.cubrid=true
profiler.jdbc.cubrid.setautocommit=true
profiler.jdbc.cubrid.commit=true
profiler.jdbc.cubrid.rollback=true
#
# DBCP
#
profiler.jdbc.dbcp=true
profiler.jdbc.dbcp.connectionclose=true
###########################################################
# Apache HTTP Client 3.x #
###########################################################
profiler.apache.httpclient3=true
profiler.apache.httpclient3.cookie=true
# When cookies should be dumped. It could be ALWAYS or EXCEPTION.
profiler.apache.httpclient3.cookie.dumptype=ALWAYS
profiler.apache.httpclient3.cookie.sampling.rate=1
# Dump entities of POST or PUT request. limited to entities which is HttpEtity.isRepeatable() == true.
profiler.apache.httpclient3.entity=true
# When entities should be dumped. ALWAYS or EXCEPTION.
profiler.apache.httpclient3.entity.dumptype=ALWAYS
profiler.apache.httpclient3.entity.sampling.rate=1
###########################################################
# Apache HTTP Client 4.x #
###########################################################
profiler.apache.httpclient4=true
profiler.apache.httpclient4.cookie=true
# When cookies should be dumped. It could be ALWAYS or EXCEPTION.
profiler.apache.httpclient4.cookie.dumptype=ALWAYS
profiler.apache.httpclient4.cookie.sampling.rate=1
# Dump entities of POST or PUT request. limited to entities which is HttpEtity.isRepeatable() == true.
profiler.apache.httpclient4.entity=true
# When entities should be dumped. ALWAYS or EXCEPTION.
profiler.apache.httpclient4.entity.dumptype=ALWAYS
profiler.apache.httpclient4.entity.sampling.rate=1
# Can profile status code value
profiler.apache.httpclient4.entity.statuscode=true
# Not supported yet
#profiler.apache.nio.httpclient4=true
###########################################################
# Ning Async HTTP Client #
###########################################################
profiler.ning.asynchttpclient=true
profiler.ning.asynchttpclient.cookie=true
profiler.ning.asynchttpclient.cookie.dumptype=ALWAYS
profiler.ning.asynchttpclient.cookie.dumpsize=1024
profiler.ning.asynchttpclient.cookie.sampling.rate=1
profiler.ning.asynchttpclient.entity=true
profiler.ning.asynchttpclient.entity.dumptype=ALWAYS
profiler.ning.asynchttpclient.entity.dumpsize=1024
profiler.ning.asynchttpclient.entity.sampling.rate=1
profiler.ning.asynchttpclient.param=true
profiler.ning.asynchttpclient.param.dumptype=ALWAYS
profiler.ning.asynchttpclient.param.dumpsize=1024
profiler.ning.asynchttpclient.param.sampling.rate=1
###########################################################
# Arcus #
###########################################################
profiler.arcus=true
profiler.arcus.keytrace=true
###########################################################
# Memcached #
###########################################################
profiler.memcached=true
profiler.memcached.keytrace=true
###########################################################
# ibatis #
###########################################################
profiler.orm.ibatis=true
###########################################################
# mybatis #
###########################################################
profiler.orm.mybatis=true
###########################################################
# spring-beans
###########################################################
profiler.spring.beans=true
profiler.spring.beans.name.pattern=
profiler.spring.beans.class.pattern=
profiler.spring.beans.annotation=org.springframework.stereotype.Controller,org.springframework.stereotype.Service,org.springframework.stereotype.Repository
+12 -10
View File
@@ -4,15 +4,9 @@
FROM tomcat:8-jre8
ENV PINPOINT_VERSION=1.6.1
ENV PINPOINT_VERSION 1.1.1
ADD start-collector.sh /usr/local/bin/
RUN chmod a+x /usr/local/bin/start-collector.sh \
&& mkdir -p /assets \
&& curl -SL https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/collector/src/main/resources/pinpoint-collector.properties -o /assets/pinpoint-collector.properties \
&& curl -SL https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/collector/src/main/resources/hbase.properties -o /assets/hbase.properties \
&& curl -SL https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-collector-$PINPOINT_VERSION.war -o pinpoint-collector.war \
RUN curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-collector-$PINPOINT_VERSION.war" -o pinpoint-collector.war \
&& rm -rf /usr/local/tomcat/webapps \
&& mkdir -p /usr/local/tomcat/webapps \
&& sed -i -e 's/8005/9005/' /usr/local/tomcat/conf/server.xml \
@@ -22,6 +16,14 @@ RUN chmod a+x /usr/local/bin/start-collector.sh \
&& unzip pinpoint-collector.war -d /usr/local/tomcat/webapps/ROOT \
&& rm -rf pinpoint-collector.war
EXPOSE 9994 9995 9996
ADD start.sh /usr/local/tomcat/start.sh
RUN chmod a+x /usr/local/tomcat/start.sh
ENTRYPOINT ["/usr/local/bin/start-collector.sh"]
ADD hbase.properties /assets/hbase.properties
ADD pinpoint-collector.properties /assets/pinpoint-collector.properties
EXPOSE 9994
EXPOSE 9995
EXPOSE 9996
CMD ["/usr/local/tomcat/start.sh"]
+22
View File
@@ -0,0 +1,22 @@
hbase.client.host=HBASE_HOST
hbase.client.port=HBASE_PORT
# hbase timeout option==================================================================================
# hbase default:true
hbase.ipc.client.tcpnodelay=true
# hbase default:60000
hbase.rpc.timeout=10000
# hbase default:Integer.MAX_VALUE
hbase.client.operation.timeout=10000
# hbase socket read timeout. default: 200000
hbase.ipc.client.socket.timeout.read=20000
# socket write timeout. hbase default: 600000
hbase.ipc.client.socket.timeout.write=60000
# ==================================================================================
# hbase client thread pool option
hbase.client.thread.max=128
hbase.client.threadPool.queueSize=5120
# prestartAllCoreThreads
hbase.client.threadPool.prestart=false
@@ -0,0 +1,30 @@
# tcp listen ip
collector.tcpListenIp=0.0.0.0
collector.tcpListenPort=COLLECTOR_TCP_PORT
# udp listen ip
collector.udpStatListenIp=0.0.0.0
collector.udpStatListenPort=COLLECTOR_UDP_STAT_LISTEN_PORT
collector.l4.ip=
collector.udpStatWorkerThread=16
collector.udpStatWorkerQueueSize=512
collector.udpStatSocketReceiveBufferSize=4194304
# span listen port ---------------------------------------------------------------------
collector.udpSpanListenIp=0.0.0.0
collector.udpSpanListenPort=COLLECTOR_UDP_SPAN_LISTEN_PORT
collector.udpSpanWorkerThread=32
collector.udpSpanWorkerQueueSize=1024
collector.udpSpanSocketReceiveBufferSize=4194304
statistics.flushPeriod=1000
cluster.enable=false
cluster.zookeeper.address=
cluster.zookeeper.sessiontimeout=
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
set -e
set -x
CLUSTER_ENABLE=${CLUSTER_ENABLE:-false}
COLLECTOR_TCP_PORT=${COLLECTOR_TCP_PORT:-9994}
COLLECTOR_UDP_STAT_LISTEN_PORT=${COLLECTOR_UDP_STAT_LISTEN_PORT:-9995}
COLLECTOR_UDP_SPAN_LISTEN_PORT=${COLLECTOR_UDP_SPAN_LISTEN_PORT:-9996}
HBASE_HOST=${HBASE_HOST:-localhost}
HBASE_PORT=${HBASE_PORT:-2181}
DISABLE_DEBUG=${DISABLE_DEBUG:-true}
cp /assets/pinpoint-collector.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
cp /assets/hbase.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed -i "s/cluster.enable=true/cluster.enable=${CLUSTER_ENABLE}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed -i "s/collector.tcpListenPort=9994/collector.tcpListenPort=${COLLECTOR_TCP_PORT}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed -i "s/collector.udpStatListenPort=9995/collector.udpStatListenPort=${COLLECTOR_UDP_STAT_LISTEN_PORT}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed -i "s/collector.udpSpanListenPort=9996/collector.udpSpanListenPort=${COLLECTOR_UDP_SPAN_LISTEN_PORT}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed -i "s/hbase.client.host=localhost/hbase.client.host=${HBASE_HOST}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed -i "s/hbase.client.port=2181/hbase.client.port=${HBASE_PORT}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
if [ "$DISABLE_DEBUG" == "true" ]; then
sed -i 's/level value="DEBUG"/level value="INFO"/' /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/log4j.xml
fi
exec /usr/local/tomcat/bin/catalina.sh run
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
set -e
set -x
COLLECTOR_TCP_PORT=${COLLECTOR_TCP_PORT:-}
COLLECTOR_UDP_STAT_LISTEN_PORT=${COLLECTOR_UDP_STAT_LISTEN_PORT:-}
COLLECTOR_UDP_SPAN_LISTEN_PORT=${COLLECTOR_UDP_SPAN_LISTEN_PORT:-}
HBASE_HOST=${HBASE_HOST:-}
HBASE_PORT=${HBASE_PORT:-}
cp /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties.bck
cp /assets/pinpoint-collector.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
cp /assets/hbase.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed 's/COLLECTOR_TCP_PORT/'"${COLLECTOR_TCP_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed 's/COLLECTOR_UDP_STAT_LISTEN_PORT/'"${COLLECTOR_UDP_STAT_LISTEN_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed 's/COLLECTOR_UDP_SPAN_LISTEN_PORT/'"${COLLECTOR_UDP_SPAN_LISTEN_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties
sed 's/HBASE_HOST/'"${HBASE_HOST}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed 's/HBASE_PORT/'"${HBASE_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
/usr/local/tomcat/bin/catalina.sh run
+21 -21
View File
@@ -1,41 +1,41 @@
# DESCRIPTION Pinpoint APM HBase (Data Storage)
# TO_BUILD docker build -t pinpoint-hbase .
# TO_RUN docker run -d --net=host -p 2181:2181 -p 60000:60000 -p 16010:16010 -p 60020:60020 -p 16030:16030 --name=pinpoint-hbase pinpoint-hbase
# TO_RUN docker run -d --net=host -p 2181:2181 -p 60000:60000 -p 60010:60010 -p 60020:60020 -p 60030:60030 --name=pinpoint-hbase pinpoint-hbase
FROM java:8-jdk
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ENV HBASE_VERSION=1.2.3
ENV HBASE_HOME=/opt/hbase/hbase-$HBASE_VERSION
ENV PINPOINT_VERSION=1.6.1
ENV HBASE_REPOSITORY=http://apache.mirrors.pair.com/hbase
ENV HBASE_SUB_REPOSITORY=http://archive.apache.org/dist/hbase
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
ENV HBASE_VERSION 1.0.2
ENV HBASE_HOME /opt/hbase/hbase-$HBASE_VERSION
ENV PINPOINT_VERSION 1.1.1
RUN mkdir -p /opt/hbase \
&& cd /opt/hbase \
&& curl -fSL "$HBASE_REPOSITORY/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz || curl -fSL "$HBASE_SUB_REPOSITORY/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz \
&& tar xfvz hbase.tar.gz \
&& rm -rf hbase.tar.gz
RUN mkdir -p /opt/hbase && \
cd /opt/hbase && \
curl -SL "http://apache.mirrors.pair.com/hbase/hbase-$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz && \
tar xfvz hbase.tar.gz && \
rm -rf hbase.tar.gz
ADD hbase-site.xml /opt/hbase/hbase-$HBASE_VERSION/conf/hbase-site.xml
RUN curl -SL "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/hbase/scripts/hbase-create.hbase" -o /opt/hbase/hbase-create.hbase \
&& $HBASE_HOME/bin/start-hbase.sh \
&& sleep 10 \
&& $HBASE_HOME/bin/hbase shell /opt/hbase/hbase-create.hbase \
&& $HBASE_HOME/bin/stop-hbase.sh
RUN curl -SL "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/scripts/hbase-create.hbase" -o /opt/hbase/hbase-create.hbase && \
$HBASE_HOME/bin/start-hbase.sh && \
sleep 10 && \
$HBASE_HOME/bin/hbase shell /opt/hbase/hbase-create.hbase && \
$HBASE_HOME/bin/stop-hbase.sh
VOLUME ["/home/pinpoint/hbase", "/home/pinpoint/zookeeper"]
VOLUME /home/pinpoint/hbase
VOLUME /home/pinpoint/zookeeper
# zookeeper
EXPOSE 2181
# HBase Master API port
EXPOSE 60000
# HBase Master Web UI
EXPOSE 16010
EXPOSE 60010
# Regionserver API port
EXPOSE 60020
# HBase Regionserver web UI
EXPOSE 16030
EXPOSE 60030
CMD /opt/hbase/hbase-$HBASE_VERSION/bin/hbase master start
ENTRYPOINT /opt/hbase/hbase-$HBASE_VERSION/bin/hbase master start
+7 -9
View File
@@ -4,15 +4,14 @@
FROM tomcat:8-jre8
ENV PINPOINT_VERSION=1.6.1
ENV PINPOINT_VERSION 1.1.1
ADD start-web.sh /usr/local/bin/
ADD start.sh /usr/local/tomcat/start.sh
ADD hbase.properties /assets/hbase.properties
ADD pinpoint-web.properties /assets/pinpoint-web.properties
RUN chmod a+x /usr/local/bin/start-web.sh \
&& mkdir -p /assets/ \
&& curl -SL https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/web/src/main/resources/pinpoint-web.properties -o /assets/pinpoint-web.properties \
&& curl -SL https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/web/src/main/resources/hbase.properties -o /assets/hbase.properties \
&& curl -SL https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-web-$PINPOINT_VERSION.war -o pinpoint-web.war \
RUN chmod a+x /usr/local/tomcat/start.sh\
&& curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-web-$PINPOINT_VERSION.war" -o pinpoint-web.war \
&& rm -rf /usr/local/tomcat/webapps \
&& mkdir -p /usr/local/tomcat/webapps \
&& unzip pinpoint-web.war -d /usr/local/tomcat/webapps/ROOT \
@@ -20,5 +19,4 @@ RUN chmod a+x /usr/local/bin/start-web.sh \
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/start-web.sh"]
CMD ["/usr/local/tomcat/start.sh"]
+22
View File
@@ -0,0 +1,22 @@
hbase.client.host=HBASE_HOST
hbase.client.port=HBASE_PORT
# hbase timeout option==================================================================================
# hbase default:true
hbase.ipc.client.tcpnodelay=true
# hbase default:60000
hbase.rpc.timeout=10000
# hbase default:Integer.MAX_VALUE
hbase.client.operation.timeout=10000
# hbase socket read timeout. default: 200000
hbase.ipc.client.socket.timeout.read=20000
# socket write timeout. hbase default: 600000
hbase.ipc.client.socket.timeout.write=60000
# ==================================================================================
# hbase client thread pool option
hbase.client.thread.max=128
hbase.client.threadPool.queueSize=5120
# prestartAllCoreThreads
hbase.client.threadPool.prestart=false
+13
View File
@@ -0,0 +1,13 @@
# local
cluster.enable=false
cluster.web.tcp.port=9995
cluster.zookeeper.address=
cluster.zookeeper.sessiontimeout=
# FIXME - should be removed for proper authentication
admin.password=admin
#log site link
#log.enable=false
#log.page.url=
#log.button.name=
-28
View File
@@ -1,28 +0,0 @@
#!/bin/bash
set -e
set -x
CLUSTER_ENABLE=${CLUSTER_ENABLE:-false}
ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
HBASE_HOST=${HBASE_HOST:-localhost}
HBASE_PORT=${HBASE_PORT:-2181}
DISABLE_DEBUG=${DISABLE_DEBUG:-true}
cp /assets/pinpoint-web.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-web.properties
cp /assets/hbase.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed -i "s/cluster.enable=true/cluster.enable=${CLUSTER_ENABLE}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-web.properties
sed -i "s/admin.password=admin/admin.password=${ADMIN_PASSWORD}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-web.properties
sed -i "s/hbase.client.host=localhost/hbase.client.host=${HBASE_HOST}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed -i "s/hbase.client.port=2181/hbase.client.port=${HBASE_PORT}/g" /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
if [ "$DISABLE_DEBUG" == "true" ]; then
sed -i 's/level value="DEBUG"/level value="INFO"/' /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/log4j.xml
fi
exec /usr/local/tomcat/bin/catalina.sh run
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
set -e
set -x
HBASE_HOST=${HBASE_HOST:-}
HBASE_PORT=${HBASE_PORT:-}
cp /assets/pinpoint-web.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-web.properties
cp /assets/hbase.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed 's/HBASE_HOST/'"${HBASE_HOST}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
sed 's/HBASE_PORT/'"${HBASE_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties
/usr/local/tomcat/bin/catalina.sh run