Skip to content

Instantly share code, notes, and snippets.

@zshamrock
Last active March 20, 2017 13:23
Show Gist options
  • Select an option

  • Save zshamrock/6538d330aa8f558c7f8dd6a6e4cfd1b3 to your computer and use it in GitHub Desktop.

Select an option

Save zshamrock/6538d330aa8f558c7f8dd6a6e4cfd1b3 to your computer and use it in GitHub Desktop.

Revisions

  1. zshamrock revised this gist Dec 16, 2016. 1 changed file with 9 additions and 5 deletions.
    14 changes: 9 additions & 5 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,19 @@
    version: '2'

    networks:
    # create a network to share between TICK services, so they could connect to each other by specifying influxdb network name
    # 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
    # alternative option would be to specify
    # an alternative option would be to specify
    # networks:
    # - influxdb
    # which put both telegraf and influxdb on the same network, but it will require to update conf/telegraf.conf influxdb output plugin into http://influxdb:8086
    # 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
    @@ -31,7 +32,8 @@ services:
    - $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 https://github.com/influxdata/influxdata-docker/issues/48
    # 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
    @@ -59,7 +61,9 @@ services:
    - $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 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
    # 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
  2. zshamrock revised this gist Dec 15, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ services:
    # alternative option would be to specify
    # networks:
    # - influxdb
    # which put both telegraf and influxdb on the same network, but it will require to update conf/telegraf.con influxdb output plugin into http://influxdb:8086
    # which put both telegraf and influxdb on the same network, but it will require to update conf/telegraf.conf influxdb output plugin into http://influxdb:8086
    network_mode: "service:influxdb"
    volumes:
    - $PWD/conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
  3. zshamrock revised this gist Dec 15, 2016. 1 changed file with 43 additions and 17 deletions.
    60 changes: 43 additions & 17 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -1,44 +1,70 @@
    version: '2'

    networks:
    # create a network to share between TICK services, so they could connect to each other by specifying influxdb network name
    influxdb:

    services:
    telegraf:
    image: telegraf:1.1.1
    container_name: 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
    # alternative option would be to specify
    # networks:
    # - influxdb
    # which put both telegraf and influxdb on the same network, but it will require to update conf/telegraf.con influxdb output plugin into http://influxdb:8086
    network_mode: "service:influxdb"
    volumes:
    - $PWD/conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    - $PWD/conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    depends_on:
    - influxdb
    influxdb:
    image: influxdb:1.1.0
    container_name: influxdb
    image: influxdb:1.1.1
    container_name: influxdb1.1.1
    ports:
    # Administrator interface port
    # Administrator interface port
    - "8083:8083"
    # HTTP API port
    # HTTP API port
    - "8086:8086"
    volumes:
    - $PWD/data/influxdb:/var/lib/influxdb
    - $PWD/conf/influxdb.conf:/etc/influxdb/influxdb.conf:ro
    - $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 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.0
    container_name: kapacitor
    image: kapacitor:1.1.1
    container_name: kapacitor1.1.1
    ports:
    - "9092:9092"
    - "9092:9092"
    volumes:
    - $PWD/data/kapacitor:/var/lib/kapacitor
    - $PWD/conf/kapacitor.conf:/etc/kapacitor/kapacitor.conf:ro
    - $PWD/data/kapacitor:/var/lib/kapacitor
    - $PWD/conf/kapacitor.conf:/etc/kapacitor/kapacitor.conf:ro
    environment:
    - KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086
    hostname: kapacitor
    - KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086
    # not sure why it is necessary to provide 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
    - influxdb
    depends_on:
    - telegraf
    - influxdb
  4. zshamrock created this gist Dec 2, 2016.
    44 changes: 44 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    version: '2'

    networks:
    influxdb:

    services:
    telegraf:
    image: telegraf:1.1.1
    container_name: telegraf
    network_mode: "service:influxdb"
    volumes:
    - $PWD/conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    depends_on:
    - influxdb
    influxdb:
    image: influxdb:1.1.0
    container_name: influxdb
    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
    networks:
    - influxdb
    command: [-config, /etc/influxdb/influxdb.conf]
    kapacitor:
    image: kapacitor:1.1.0
    container_name: kapacitor
    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
    hostname: kapacitor
    networks:
    - influxdb
    depends_on:
    - telegraf
    - influxdb