-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #610 from ascrutae/feature/support-docker-image
support collector docker images
- Loading branch information
Showing
8 changed files
with
200 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM openjdk:8u111-jdk | ||
|
||
ENV ZK_ADDRESSES=127.0.0.1:2181 \ | ||
ES_CLUSTER_NAME=CollectorDBCluster \ | ||
ES_ADDRESSES=localhost:9300 \ | ||
BIND_HOST=localhost \ | ||
NAMING_BIND_HOST=localhost \ | ||
NAMING_BIND_PORT=10800 \ | ||
REMOTE_BIND_PORT=11800 \ | ||
AGENT_GRPC_BIND_PORT=11800 \ | ||
AGENT_JETTY_BIND_HOST=localhost \ | ||
AGENT_JETTY_BIND_PORT=12800 \ | ||
UI_JETTY_BIND_PORT=12800 \ | ||
UI_JETTY_BIND_HOST=localhost | ||
|
||
ADD skywalking-collector.tar.gz /usr/local | ||
COPY collectorService.sh /usr/local/skywalking-collector/bin | ||
COPY log4j2.xml /usr/local/skywalking-collector/config | ||
COPY application.yml /usr/local/skywalking-collector/config | ||
COPY docker-entrypoint.sh / | ||
|
||
RUN chmod +x /usr/local/skywalking-collector/bin/collectorService.sh && chmod +x /docker-entrypoint.sh | ||
|
||
EXPOSE 10800 | ||
EXPOSE 11800 | ||
EXPOSE 12800 | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["/usr/local/skywalking-collector/bin/collectorService.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cluster: | ||
zookeeper: | ||
hostPort: {ZK_ADDRESSES} | ||
sessionTimeout: 100000 | ||
naming: | ||
jetty: | ||
host: {NAMING_BIND_HOST} | ||
port: {NAMING_BIND_PORT} | ||
context_path: / | ||
remote: | ||
gRPC: | ||
host: {BIND_HOST} | ||
port: {REMOTE_BIND_PORT} | ||
agent_gRPC: | ||
gRPC: | ||
host: {BIND_HOST} | ||
port: {AGENT_GRPC_BIND_PORT} | ||
agent_jetty: | ||
jetty: | ||
host: {AGENT_JETTY_BIND_HOST} | ||
port: {AGENT_JETTY_BIND_PORT} | ||
context_path: / | ||
agent_stream: | ||
default: | ||
buffer_file_path: ../buffer/ | ||
buffer_offset_max_file_size: 10M | ||
buffer_segment_max_file_size: 500M | ||
ui: | ||
jetty: | ||
host: {UI_JETTY_BIND_HOST} | ||
port: {UI_JETTY_BIND_PORT} | ||
context_path: / | ||
storage: | ||
elasticsearch: | ||
cluster_name: {ES_CLUSTER_NAME} | ||
cluster_transport_sniffer: true | ||
cluster_nodes: {ES_ADDRESSES} | ||
index_shards_number: 2 | ||
index_replicas_number: 0 |
23 changes: 23 additions & 0 deletions
23
apm-collector/apm-collector-boot/docker/collectorService.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env sh | ||
|
||
PRG="$0" | ||
PRGDIR=`dirname "$PRG"` | ||
[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` | ||
|
||
COLLECT_LOG_DIR="${COLLECTOR_HOME}/logs" | ||
JAVA_OPTS=" -Xms256M -Xmx512M" | ||
|
||
if [ ! -d "${COLLECTOR_HOME}/logs" ]; then | ||
mkdir -p "${COLLECT_LOG_DIR}" | ||
fi | ||
|
||
_RUNJAVA=${JAVA_HOME}/bin/java | ||
[ -z "$JAVA_HOME" ] && _RUNJAVA=java | ||
|
||
CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH" | ||
for i in "$COLLECTOR_HOME"/libs/*.jar | ||
do | ||
CLASSPATH="$i:$CLASSPATH" | ||
done | ||
|
||
${_RUNJAVA} ${JAVA_OPTS} -classpath $CLASSPATH org.skywalking.apm.collector.boot.CollectorBootStartUp |
40 changes: 40 additions & 0 deletions
40
apm-collector/apm-collector-boot/docker/docker-entrypoint.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
echo "replace {ZK_ADDRESSES} to ${ZK_ADDRESSES}" | ||
eval sed -i -e 's/\{ZK_ADDRESSES\}/${ZK_ADDRESSES}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {ES_CLUSTER_NAME} to ${ES_CLUSTER_NAME}" | ||
eval sed -i -e 's/\{ES_CLUSTER_NAME\}/${ES_CLUSTER_NAME}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {ES_ADDRESSES} to ${ES_ADDRESSES}" | ||
eval sed -i -e 's/\{ES_ADDRESSES\}/${ES_ADDRESSES}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {BIND_HOST} to ${BIND_HOST}" | ||
eval sed -i -e 's/\{BIND_HOST\}/${BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {NAMING_BIND_HOST} to ${NAMING_BIND_HOST}" | ||
eval sed -i -e 's/\{NAMING_BIND_HOST\}/${NAMING_BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {NAMING_BIND_PORT} to ${NAMING_BIND_PORT}" | ||
eval sed -i -e 's/\{NAMING_BIND_PORT\}/${NAMING_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {REMOTE_BIND_PORT} to ${REMOTE_BIND_PORT}" | ||
eval sed -i -e 's/\{REMOTE_BIND_PORT\}/${REMOTE_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {AGENT_GRPC_BIND_PORT} to ${AGENT_GRPC_BIND_PORT}" | ||
eval sed -i -e 's/\{AGENT_GRPC_BIND_PORT\}/${AGENT_GRPC_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {AGENT_JETTY_BIND_HOST} to ${AGENT_JETTY_BIND_HOST}" | ||
eval sed -i -e 's/\{AGENT_JETTY_BIND_HOST\}/${AGENT_JETTY_BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {AGENT_JETTY_BIND_PORT} to ${AGENT_JETTY_BIND_PORT}" | ||
eval sed -i -e 's/\{AGENT_JETTY_BIND_PORT\}/${AGENT_JETTY_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {UI_JETTY_BIND_PORT} to ${UI_JETTY_BIND_PORT}" | ||
eval sed -i -e 's/\{UI_JETTY_BIND_PORT\}/${UI_JETTY_BIND_PORT}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
echo "replace {UI_JETTY_BIND_HOST} to ${UI_JETTY_BIND_HOST}" | ||
eval sed -i -e 's/\{UI_JETTY_BIND_HOST\}/${UI_JETTY_BIND_HOST}/' /usr/local/skywalking-collector/config/application.yml | ||
|
||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2017, OpenSkywalking Organization All rights reserved. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
~ Project repository: https://github.com/OpenSkywalking/skywalking | ||
--> | ||
|
||
<Configuration status="info"> | ||
<Appenders> | ||
<Console name="Console" target="SYSTEM_OUT"> | ||
<PatternLayout charset="UTF-8" pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/> | ||
</Console> | ||
</Appenders> | ||
<Loggers> | ||
<logger name="org.eclipse.jetty" level="INFO"/> | ||
<logger name="org.apache.zookeeper" level="INFO"/> | ||
<logger name="org.skywalking.apm.collector.agent.grpc.handler.JVMMetricsServiceHandler" level="INFO"/> | ||
<logger name="org.skywalking.apm.collector.stream.timer.PersistenceTimer" level="INFO"/> | ||
<logger name="io.grpc.netty" level="INFO"/> | ||
<Root level="info"> | ||
<AppenderRef ref="Console"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters