title: How to Change Port Number in cadvisor and node-exporter of Prometheus Monitoring
body: <p>Below is the showing in prometheus URL when i click on target.</p>
  <p><strong>cadvisor (0/1 up) and node-exporter (0/1 up) are showing in Prometheus URL</strong></p>
  <p>Here is the my filename.yml file</p>
  <pre><code>version: '3.2'
  
  services:
  
    prometheus:
         image: prom/prometheus:latest
  #       container_name: monitoring_prometheus
         command:
           - '--config.file=/etc/prometheus/prometheus.yml'
           - '--storage.tsdb.path=/prometheus'
           - '--web.console.libraries=/usr/share/prometheus/console_libraries'
           - '--web.console.templates=/usr/share/prometheus/consoles'
         volumes:
           - /Prometheus/alert.rules:/etc/prometheus/alert.rules
           - /Prometheus/container.yml:/etc/prometheus/container.yml
           - /Prometheus/diskusage.yml:/etc/prometheus/diskusage.yml
           - ./prometheus.yml:/etc/prometheus/prometheus.yml
         ports:
           - 9090:9090
  
    node-exporter:       
         image: prom/node-exporter:latest
  #       container_name: monitoring_node_exporter       
         volumes:       
           - /proc:/host/proc:ro       
           - /sys:/host/sys:ro       
           - /:/rootfs:ro       
         ports:
           - 9091:9091
         command:       
           - '--path.procfs=/host/proc'       
           - '--path.sysfs=/host/sys'       
           - '--path.rootfs=/host'       
           - '--collector.filesystem.ignored-mount-points=&quot;^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)&quot;'       
           - '--collector.filesystem.ignored-fs-types=&quot;^(sys|proc|auto|cgroup|devpts|ns|au|fuse\.lxc|mqueue)(fs|)$$&quot;'       
  
  
    cadvisor:
         image: google/cadvisor:latest
  #       container_name: monitoring_cadvisor
         ports:
           - 9092:9092
         volumes:
           - /:/rootfs:ro
           - /var/run:/var/run:rw
           - /sys:/sys:ro
           - /var/lib/docker/:/var/lib/docker:ro
  
  
    grafana:
         image: grafana/grafana:latest
  #       image: grafana-custom:latest
  #       container_name: monitoring_grafana   
         volumes:
           - grafana-data:/var/lib/grafana
  #         - ./data/grafana:/var/lib/grafana
  #         - ./grafana/provisioning:/etc/grafana/provisioning
  #         - ./defaults.ini:/usr/share/grafana/conf/defaults.ini
         ports:
           - 3000:3000
         environment:
           - &quot;GF_SMTP_ENABLED=true&quot; 
           - &quot;GF_SMTP_HOST=smtp.gmail.com:465&quot; 
           - &quot;GF_SMTP_USER=test@gmail.com&quot; 
           - &quot;GF_SMTP_PASSWORD=xxxxxx&quot; 
  
    alertmanager:
         image: prom/alertmanager
  #        privileged: true
         volumes:
           - ./alertmanager.yml:/alertmanager.yml
         command:
           - '--config.file=/alertmanager.yml'
         ports:
           - '9093:9093'
   
    karma-alert-dashboard:
  #       image: cloudflare/unsee
         image: lmierzwa/karma:latest
         environment:
  #         - &quot;ALERTMANAGER_URIS=default:http://alertmanager:9093&quot;
           - &quot;ALERTMANAGER_URI=http://alertmanager:9093&quot;
         ports:
           - '9094:9094'
  
  
  volumes:
    grafana-data:
  </code></pre>
  <p>I have deploy 5 docker service through docker stack -c filename.yml test, All services and docker container are UP.</p>
  <p>First 3 are connected together and are working fine</p>
  <blockquote>
  <pre><code>Grafana      =  http://SERVERIP:3000/ - 3000  
  Prometheus   =  http://SERVERIP:9090/ - 9090  
  AlertManager =  http://SERVERIP:9093/ - 9093  
  </code></pre>
  </blockquote>
  <p>Last 3 are Not connected together and are Not working fine because of port issue in docker container and in docker service also</p>
  <blockquote>
  <pre><code>Karma        =  http://SERVERIP:9094/ - 8080  
  Node Exporter=  http://SERVERIP:9100/ - 9100  
  CAdvisor     =  http://SERVERIP:8080/ - 8080
  </code></pre>
  </blockquote>
  <p>Here is the screenshot:
  <a href="https://i.stack.imgur.com/Kvc3d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kvc3d.png" alt="enter image description here" /></a></p>
  <p>When i check ports number 3 services are showing different in terminal but in my filename.yml everything is correct can anyone let me what is the issue and where i'm wrong</p>
  <p>When i check logs of 3 docker container</p>
  <ol>
  <li>docker logs cadvisor</li>
  </ol>
  <pre><code>Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory
  </code></pre>
  <ol start="2">
  <li>node-exporter is not showing any logs.</li>
  <li>Here is the logs of lmierzwa/karma</li>
  </ol>
  <pre><code>level=info msg=&quot;Version: v0.86-83-gf5e5269f&quot;
  level=info msg=&quot;Configured Alertmanager source&quot; name=default proxy=false readonly=false uri=http://alertmanager:9093
  level=info msg=&quot;Initial Alertmanager collection&quot;
  level=info msg=&quot;Pulling latest alerts and silences from Alertmanager&quot;
  level=info msg=&quot;Collecting alerts and silences&quot; alertmanager=default
  level=info msg=&quot;GET request&quot; timeout=40 uri=http://alertmanager:9093/metrics
  level=info msg=&quot;Upstream version&quot; alertmanager=default version=0.22.2
  level=info msg=&quot;Got silences&quot; alertmanager=default duration=0.000204419 silences=0
  level=info msg=&quot;Detecting ticket links in silences&quot; alertmanager=default silences=0
  level=info msg=&quot;Collected alert groups&quot; alertmanager=default duration=0.000201856 groups=0
  level=info msg=&quot;Deduplicating alert groups&quot; alertmanager=default groups=0
  level=info msg=&quot;Processing deduplicated alert groups&quot; alertmanager=default groups=0
  level=info msg=&quot;Merging autocomplete hints&quot; alertmanager=default hints=0
  level=info msg=&quot;Collection completed&quot;
  level=info msg=&quot;Done, starting HTTP server&quot;
  level=info msg=&quot;Starting HTTP server&quot; address=[::]:8080
  level=info msg=&quot;Pulling latest alerts and silences from Alertmanager&quot;
  level=info msg=&quot;Collecting alerts and silences&quot; alertmanager=default
  level=info msg=&quot;GET request&quot; timeout=40 uri=http://alertmanager:9093/metrics
  level=info msg=&quot;Upstream version&quot; alertmanager=default version=0.22.2
  level=info msg=&quot;Got silences&quot; alertmanager=default duration=0.000155633 silences=0
  </code></pre>