Last active
March 20, 2017 13:23
-
-
Save zshamrock/6538d330aa8f558c7f8dd6a6e4cfd1b3 to your computer and use it in GitHub Desktop.
TICK services docker compose
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
version: '2' | |
networks: | |
# create a network to share between TICK services, so they can connect to each other by specifying influxdb network name | |
influxdb: | |
services: | |
telegraf: | |
image: telegraf:1.1.2 | |
container_name: telegraf1.1.2 | |
# use network_mode: "service:influxdb" to be able to use http://localhost:8086 to connect influxdb output plugin | |
# an alternative option would be to specify | |
# networks: | |
# - influxdb | |
# which puts both Telegraf and InfluxDB on the same network, | |
# but does require to update conf/telegraf.conf: set urls of [[output.influxdb]] into http://influxdb:8086 | |
network_mode: "service:influxdb" | |
volumes: | |
- $PWD/conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro | |
depends_on: | |
- influxdb | |
influxdb: | |
image: influxdb:1.1.1 | |
container_name: influxdb1.1.1 | |
ports: | |
# Administrator interface port | |
- "8083:8083" | |
# HTTP API port | |
- "8086:8086" | |
volumes: | |
- $PWD/data/influxdb:/var/lib/influxdb | |
- $PWD/conf/influxdb.conf:/etc/influxdb/influxdb.conf:ro | |
environment: | |
# to enable admin interface, or otherwise from influxdb.conf [admin]/enable | |
# although it is planned to be removed from the product, | |
# see for the details https://github.com/influxdata/influxdata-docker/issues/48 | |
- INFLUXDB_ADMIN_ENABLED=true | |
networks: | |
- influxdb | |
command: [-config, /etc/influxdb/influxdb.conf] | |
chronograf: | |
image: quay.io/influxdb/chronograf:1.1.0-beta2 | |
container_name: chronograf1.1.0-beta2 | |
ports: | |
- "8888:8888" | |
volumes: | |
- $PWD/conf/chronograf.conf:/etc/chronograf/chronograf.conf:ro | |
networks: | |
- influxdb | |
depends_on: | |
- telegraf | |
- influxdb | |
- kapacitor | |
kapacitor: | |
image: kapacitor:1.1.1 | |
container_name: kapacitor1.1.1 | |
ports: | |
- "9092:9092" | |
volumes: | |
- $PWD/data/kapacitor:/var/lib/kapacitor | |
- $PWD/conf/kapacitor.conf:/etc/kapacitor/kapacitor.conf:ro | |
environment: | |
- KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086 | |
# not sure why it is necessary to provide a hostname, | |
# but it looks like Kapacitor subscribes to the InfluxDB by connecting to KAPACITOR_INFLUXDB_0_URLS_0 | |
# and probably sends its own hostname on the way, so InfluxDB can communicate back | |
# at least this line below is from the influxdb logs: | |
# influxdb1.1.1 | [query] 2016/12/15 10:19:54 CREATE SUBSCRIPTION "kapacitor-7a54eb73-75f6-488b-9190-830f8846a1c2" ON telegraf.autogen DESTINATIONS ANY 'http://kapacitor:9092' | |
hostname: kapacitor | |
networks: | |
- influxdb | |
depends_on: | |
- telegraf | |
- influxdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment