Skip to content

Instantly share code, notes, and snippets.

@yanmhlv
Last active January 30, 2017 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanmhlv/bd336e081db7fbd087fec54ceeea9e2c to your computer and use it in GitHub Desktop.
Save yanmhlv/bd336e081db7fbd087fec54ceeea9e2c to your computer and use it in GitHub Desktop.
InfluxDB official docker image + Prometheus
version: '2'
services:
influxdb:
image: influxdb:1.2.0-alpine
ports:
- 8083:8083
- 8086:8086
- 8088:8088
volumes:
- "$PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro"
command: influxd -config /etc/influxdb/influxdb.conf
environment:
- INFLUXDB_GRAPHITE_ENABLED=true
- INFLUXDB_REPORTING_DISABLED=true
# - INFLUXDB_META_DIR=/path/to/metadir
# - INFLUXDB_DATA_QUERY_LOG_ENABLED=false
prometheus:
image: prom/prometheus
ports:
- 9090:9090
@yanmhlv
Copy link
Author

yanmhlv commented Jan 30, 2017

$ docker run --rm influxdb:1.2.0-alpine influxd config > influxdb.conf

$ curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"
$ curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
$ curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SELECT value FROM cpu_load_short WHERE region='us-west'"

@yanmhlv
Copy link
Author

yanmhlv commented Jan 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment