Search code examples
dockerinfluxdbcadvisor

influxDB and cadvisor integration issue


I want to access to the gathered data from cadvisor through influxdb here my docker configurations:

//for cadvisor
docker run     
--volume=/:/rootfs:ro     
--volume=/var/run:/var/run:rw     
--volume=/sys:/sys:ro     
--volume=/var/lib/docker/:/var/lib/docker:ro     
--publish=8080:8080     
--detach=true     
--name=cadvisorDB     
google/cadvisor:latest     
-storage_driver=influxdb     
-storage_driver_host=127.0.0.1:8086
-storage_driver_db=databaseName

//for InfluxDB
docker run 
-d 
-p 8083:8083 
-p 8086:8086 
--expose 8090 
--expose 8099 
tutum/influxdb
//and I created manually the databse through the WEB UI on localhost:8083   
with the name databaseName`

So once I start the two containers, I go to the influxDB to explore data (by making a query). An error says that there is no data


Solution

  • Everything in the configuration looks fine. The problem is probably in this line:

    -storage_driver_host=127.0.0.1:8086

    because 127.0.0.1 is refering to cadvisor container localhost and not your localhost. Try to put instead docker Nat ip (usually 172.17.42.1).