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

  • When I run the image on my PC for Docker, I got below error all the time
  • Everything inside one docker container or specialized containers
  • Configuring Spark Job Server to work with cluster
  • Docker: HTTP code 403 while uploading metadata: “invalid character '<' looking for beginning of value”
  • Getting 502 Bad Gateway while running the Django application within a docker container?
  • Install Docker Toolbox on a Mac via command line
  • Can't mount a secret volume to kubernetes
  • Library installation in docker
  • Docker. Run software with license based on host id
  • Error mounting volumes on Openshift (Next gen)
  • How can I launch an IronWorker with Docker without needing to pay for private Docker repositories, nor make my code public?
  • How to create “RegistryAuth” for Private Registry Login Credentials
  • 2 Solutions collect form web for “influxDB and cadvisor integration issue”

    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).

    This is what I use in my “docker-compose” YAML file. Should be very easy to translate to the usual “docker run” syntax. In my case I’m linking the InfluxDB container in cAdvisor, so cAdvisor knows how to resolve the hostname “influxdb” regardless of the internal Docker IP assigned to the container.

    influxdb:
      image: tutum/influxdb
      hostname: influxdb
      volumes:
        - ./influxdb:/data
      environment:
        - PRE_CREATE_DB=cadvisor
      ports:
        - "8083:8083"
        - "8086:8086"
      expose:
        - "8090"
        - "8099"
    
    cadvisor:
      image: google/cadvisor
      hostname: cadvisor
      volumes:
        - /:/rootfs:ro
        - /var/run:/var/run:rw
        - /sys:/sys:ro
        - /var/lib/docker:/var/lib/docker:ro
      ports:
        - "8089:8080"
      links:
        - influxdb
      command: -storage_driver_db=cadvisor -storage_driver_host=influxdb:8086
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.