From 19be41675a05096433a601e0faf82cdf56635969 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Sun, 18 Jun 2017 17:32:13 +0800 Subject: [PATCH] Fix start collector image failed --- .../apm-collector-worker/docker/Dockerfile | 4 +- .../docker/collector.config | 87 ++++++++----------- .../docker/docker-entrypoint.sh | 12 +-- .../apm-collector-worker/docker/log4j2.xml | 13 +++ 4 files changed, 51 insertions(+), 65 deletions(-) create mode 100644 apm-collector/apm-collector-worker/docker/log4j2.xml diff --git a/apm-collector/apm-collector-worker/docker/Dockerfile b/apm-collector/apm-collector-worker/docker/Dockerfile index d9d25058a..a69641df8 100644 --- a/apm-collector/apm-collector-worker/docker/Dockerfile +++ b/apm-collector/apm-collector-worker/docker/Dockerfile @@ -9,12 +9,12 @@ ENV CLUSTER_CURRENT_HOST_NAME=127.0.0.1 \ ES_INDEX_SHARDS_NUMBER=2 \ ES_INDEX_REPLICAS_NUMBER=0 \ HTTP_HOST_NAME=127.0.0.1 \ - HTTP_PORT=12800 \ - HTTP_CONTEXT_PATH=/ + HTTP_PORT=12800 ADD skywalking-collector.tar.gz /usr/local COPY startup.sh /usr/local/skywalking-collector/bin COPY collector.config /usr/local/skywalking-collector/config +COPY log4j2.xml /usr/local/skywalking-collector/config ADD docker-entrypoint.sh / RUN chmod +x /docker-entrypoint.sh && chmod +x /usr/local/skywalking-collector/bin/startup.sh diff --git a/apm-collector/apm-collector-worker/docker/collector.config b/apm-collector/apm-collector-worker/docker/collector.config index 9a74bb4f2..d0cb0628d 100644 --- a/apm-collector/apm-collector-worker/docker/collector.config +++ b/apm-collector/apm-collector-worker/docker/collector.config @@ -1,63 +1,46 @@ -cluster.current.hostname={CLUSTER_CURRENT_HOST_NAME} -cluster.current.port={CLUSTER_CURRENT_PORT} +#"hostname" and "port" are used to receive internal messages from other nodes of cluster。 +# Hostname can be either hostname or IP address. +cluster.current.hostname = {CLUSTER_CURRENT_HOST_NAME} +# Listening port. +cluster.current.port = {CLUSTER_CURRENT_PORT} + +# In this version, all members have same roles, and everyone of them is listening the status of others. +#The routers do not send message to nodes, which is unreachable, caused by network trouble, jvm crash or any other reasons. cluster.current.roles={CLUSTER_CURRENT_ROLES} + +#Initial contact points of the cluster, e.g. seed_nodes = 127.0.0.1:11800, 127.0.0.1:11801. +#The nodes to join automatically at startup. +#When setting akka configuration, it will be change. +#like: ["akka.tcp://system@127.0.0.1:11800", "akka.tcp://system@127.0.0.1:11801"]. +#This is akka configuration, see: http://doc.akka.io/docs/akka/2.4/general/configuration.html cluster.seed_nodes={CLUSTER_SEED_NODES} -es.cluster.name={ES_CLUSTER_NAME} +#elasticsearch configuration, see cluster.name in "config/elasticsearch.yml" +es.cluster.name = {ES_CLUSTER_NAME} +es.cluster.transport.sniffer = true + +# The elasticsearch nodes of cluster, separated by comma, e.g. nodes=ip:port, ip:port es.cluster.nodes={ES_CLUSTER_NODES} -es.cluster.transport.sniffer=true -es.index.shards.number={ES_INDEX_SHARDS_NUMBER} -es.index.replicas.number={ES_INDEX_REPLICAS_NUMBER} +#Initialized mode of elasticsearch index, default is auto. +#Options: auto, forced, manual +#auto: create index when it doesn't exist. +# forced: delete and create. +# manual: do nothing. +es.index.initialize.mode=auto +# Config of shards or replicas in Elasticsearch. +es.index.shards.number=2 +es.index.replicas.number=0 +# "hostname", "port" and "contextPath" are used to provide HTTP RESTful services. +# RESTful services include "receive segment" and "webui query services". http.hostname={HTTP_HOST_NAME} http.port={HTTP_PORT} -http.contextPath={HTTP_CONTEXT_PATH} +# Web context path +http.contextPath=/ +# Cache size of analysis worker. The value determines whether sending to next worker and clear, or not. cache.analysis.size=1024 -cache.persistence.size=1024 - -WorkerNum.Node.NodeCompAgg.Value=10 -WorkerNum.Node.NodeMappingDayAgg.Value=10 -WorkerNum.Node.NodeMappingHourAgg.Value=10 -WorkerNum.Node.NodeMappingMinuteAgg.Value=10 - -WorkerNum.NodeRef.NodeRefDayAgg.Value=10 -WorkerNum.NodeRef.NodeRefHourAgg.Value=10 -WorkerNum.NodeRef.NodeRefMinuteAgg.Value=10 -WorkerNum.NodeRef.NodeRefResSumDayAgg.Value=10 -WorkerNum.NodeRef.NodeRefResSumHourAgg.Value=10 -WorkerNum.NodeRef.NodeRefResSumMinuteAgg.Value=10 - -WorkerNum.GlobalTrace.GlobalTraceAgg.Value=10 - -Queue.GlobalTrace.GlobalTraceSave.Size=1024 -Queue.GlobalTrace.GlobalTraceAnalysis.Size=1024 - -Queue.Segment.SegmentPost.Size=1024 -Queue.Segment.SegmentCostSave.Size=1024 -Queue.Segment.SegmentSave.Size=1024 -Queue.Segment.SegmentExceptionSave.Size=1024 - -Queue.Node.NodeCompAnalysis.Size=1024 -Queue.Node.NodeMappingDayAnalysis.Size=1024 -Queue.Node.NodeMappingHourAnalysis.Size=1024 -Queue.Node.NodeMappingMinuteAnalysis.Size=1024 -Queue.Node.NodeCompSave.Size=1024 -Queue.Node.NodeMappingDaySave.Size=1024 -Queue.Node.NodeMappingHourSave.Size=1024 -Queue.Node.NodeMappingMinuteSave.Size=1024 - -Queue.NodeRef.NodeRefDayAnalysis.Size=1024 -Queue.NodeRef.NodeRefHourAnalysis.Size=1024 -Queue.NodeRef.NodeRefMinuteAnalysis.Size=1024 -Queue.NodeRef.NodeRefDaySave.Size=1024 -Queue.NodeRef.NodeRefHourSave.Size=1024 -Queue.NodeRef.NodeRefMinuteSave.Size=1024 -Queue.NodeRef.NodeRefResSumDaySave.Size=1024 -Queue.NodeRef.NodeRefResSumHourSave.Size=1024 -Queue.NodeRef.NodeRefResSumMinuteSave.Size=1024 -Queue.NodeRef.NodeRefResSumDayAnalysis.Size=1024 -Queue.NodeRef.NodeRefResSumHourAnalysis.Size=1024 -Queue.NodeRef.NodeRefResSumMinuteAnalysis.Size=1024 +# Cache size of persistence worker. The value determines whether save data and clear, or not. +cache.persistence.size=4096 diff --git a/apm-collector/apm-collector-worker/docker/docker-entrypoint.sh b/apm-collector/apm-collector-worker/docker/docker-entrypoint.sh index 4d7fe1d42..f00f5e52d 100644 --- a/apm-collector/apm-collector-worker/docker/docker-entrypoint.sh +++ b/apm-collector/apm-collector-worker/docker/docker-entrypoint.sh @@ -15,23 +15,13 @@ eval sed -i -e 's/\{CLUSTER_SEED_NODES\}/$CLUSTER_SEED_NODES/' /usr/local/skywal echo "replace ES_CLUSTER_NAME with $ES_CLUSTER_NAME" eval sed -i -e 's/\{ES_CLUSTER_NAME\}/$ES_CLUSTER_NAME/' /usr/local/skywalking-collector/config/collector.config - echo "replcae ES_CLUSTER_NODES with $ES_CLUSTER_NODES" eval sed -i -e 's/\{ES_CLUSTER_NODES\}/$ES_CLUSTER_NODES/' /usr/local/skywalking-collector/config/collector.config -echo "replace ES_INDEX_SHARDS_NUMBER with $ES_INDEX_SHARDS_NUMBER" -eval sed -i -e 's/\{ES_INDEX_SHARDS_NUMBER\}/$ES_INDEX_SHARDS_NUMBER/' /usr/local/skywalking-collector/config/collector.config - -echo "replace ES_INDEX_REPLICAS_NUMBER with $ES_INDEX_REPLICAS_NUMBER" -eval sed -i -e 's/\{ES_INDEX_REPLICAS_NUMBER\}/$ES_INDEX_REPLICAS_NUMBER/' /usr/local/skywalking-collector/config/collector.config - echo "replace HTTP_HOST_NAME with $HTTP_HOST_NAME" eval sed -i -e 's/\{HTTP_HOST_NAME\}/$HTTP_HOST_NAME/' /usr/local/skywalking-collector/config/collector.config echo "replace HTTP_PORT with $HTTP_PORT" eval sed -i -e 's/\{HTTP_PORT\}/$HTTP_PORT/' /usr/local/skywalking-collector/config/collector.config -echo "replace HTTP_CONTEXT_PATH with $HTTP_CONTEXT_PATH" -eval sed -i -e 's/\{HTTP_CONTEXT_PATH\}/$HTTP_CONTEXT_PATH/' /usr/local/skywalking-collector/config/collector.config - -exec "$@" \ No newline at end of file +exec "$@" diff --git a/apm-collector/apm-collector-worker/docker/log4j2.xml b/apm-collector/apm-collector-worker/docker/log4j2.xml new file mode 100644 index 000000000..128a7864e --- /dev/null +++ b/apm-collector/apm-collector-worker/docker/log4j2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + +