commit e498db649a8ccb2c6121390120d5c5635d1ce06a Author: Gregory Eremin Date: Wed Jul 6 20:50:23 2016 +0200 Initial commit (carbon is set up) diff --git a/Dockerfile-carbon b/Dockerfile-carbon new file mode 100644 index 0000000..7e1a040 --- /dev/null +++ b/Dockerfile-carbon @@ -0,0 +1,16 @@ +FROM ubuntu:14.04 +MAINTAINER Gregory Eremin + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get install -y make git golang + +RUN mkdir /build +RUN cd /build && git clone https://github.com/lomik/go-carbon.git +WORKDIR /build/go-carbon +RUN git checkout v0.7.2 +RUN make submodules && make + +COPY configs/carbon.toml /etc/carbon.toml +COPY configs/storage-schemas.conf /etc/storage-schemas.conf +RUN mkdir -p /data/graphite/whisper +ENTRYPOINT ./go-carbon -config=/etc/carbon.toml diff --git a/configs/carbon.toml b/configs/carbon.toml new file mode 100644 index 0000000..ec20b25 --- /dev/null +++ b/configs/carbon.toml @@ -0,0 +1,59 @@ +[common] +# If logfile is empty use stderr +logfile = "" +# Logging error level. Valid values: "debug", "info", "warn", "warning", "error" +log-level = "info" +# Prefix for store all internal go-carbon graphs. Supported macroses: {host} +graph-prefix = "carbon.agents.{host}." +# Interval of storing internal metrics. Like CARBON_METRIC_INTERVAL +metric-interval = "1m0s" +# Increase for configuration with multi persisters +max-cpu = 1 + +[whisper] +data-dir = "/data/graphite/whisper/" +# http://graphite.readthedocs.org/en/latest/config-carbon.html#storage-schemas-conf. Required +schemas-file = "/etc/storage-schemas.conf" +# http://graphite.readthedocs.org/en/latest/config-carbon.html#storage-aggregation-conf. Optional +aggregation-file = "" +# Workers count. Metrics sharded by "crc32(metricName) % workers" +workers = 1 +# Limits the number of whisper update_many() calls per second. 0 - no limit +max-updates-per-second = 0 +# Sparse file creation +sparse-create = false +enabled = true + +[cache] +# Limit of in-memory stored points (not metrics) +max-size = 1000000 +# Capacity of queue between receivers and cache +input-buffer = 51200 + +[udp] +listen = ":2003" +enabled = true +# Enable optional logging of incomplete messages (chunked by MTU) +log-incomplete = false + +[tcp] +listen = ":2003" +enabled = true + +[pickle] +listen = ":2004" +enabled = false +# Limit message size for prevent memory overflow +max-message-size = 67108864 + +[carbonlink] +listen = "127.0.0.1:7002" +enabled = true +# Close inactive connections after "read-timeout" +read-timeout = "30s" +# Return empty result if cache not reply +query-timeout = "100ms" + +[pprof] +listen = "localhost:7007" +enabled = false diff --git a/configs/storage-schemas.conf b/configs/storage-schemas.conf new file mode 100644 index 0000000..f7ba9a6 --- /dev/null +++ b/configs/storage-schemas.conf @@ -0,0 +1,15 @@ +# Documentation +# http://graphite.readthedocs.io/en/latest/config-carbon.html#storage-schemas-conf + +# Carbon metrics are kept for 30 days in resolution of 10 seconds. +[carbon] +pattern = ^carbon\. +retentions = 10s:30d + +# User metrics are kept for: +# * 24 hours in resolution of 5 seconds +# * 30 days in resolution of 1 minute +# * 1 year in resolution of 5 minutes +[user] +pattern = .* +retentions = 5s:24h,1m:30d,5m:1y