Collecting Elasticsearch monitoring data with Metricbeat in docker deployment

What is the best practice to switch from legacy to metricbeat monitoring for clusters deployed in docker.?
How should I modify our docker compose file to incorporate metricbeat for internal Elasticsearch monitoring.
Is there any guideline document which I can follow ?

My elastsicsearch setup looks like:

should I put 1 or 3 metricbeat containers on each host to monitor particular elastic container?
is this the way?

my docker compose is like:

version: "3.3"
services:
  es-elasticnode-11:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.13.3
    container_name: es-elasticnode-11
    restart: always
    environment:
      - node.name=es-elasticnode-11      
      - http.cors.enabled=true
      - http.cors.allow-origin=*      
      - "ES_JAVA_OPTS=-Xms15g -Xmx15g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /mnt/ssd1/esdata1:/usr/share/elasticsearch/data
      - /data/elasticsearch_es-elasticnode-11.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /data/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12
    ports:
      - 9200:9200
      - 9300:9300
    deploy:
      resources:
        limits:
          cpus: "12"
    network_mode: host
  es-elasticnode-12:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.13.3
    container_name: es-elasticnode-12
    restart: always
    environment:
      - node.name=es-elasticnode-12      
      - http.cors.enabled=true
      - http.cors.allow-origin=*      
      - "ES_JAVA_OPTS=-Xms15g -Xmx15g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /mnt/ssd2/esdata2:/usr/share/elasticsearch/data
      - /data/elasticsearch_es-elasticnode-12.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /data/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12
    ports:
      - 9201:9201
      - 9301:9301
    deploy:
      resources:
        limits:
          cpus: "12"
    network_mode: host
  es-elasticnode-13:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.13.3
    container_name: es-elasticnode-13
    restart: always
    environment:
      - node.name=es-elasticnode-13      
      - http.cors.enabled=true
      - http.cors.allow-origin=*      
      - "ES_JAVA_OPTS=-Xms15g -Xmx15g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /mnt/ssd3/esdata3:/usr/share/elasticsearch/data
      - /data/elasticsearch_es-elasticnode-13.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /data/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12
    ports:
      - 9202:9202
      - 9302:9302
    deploy:
      resources:
        limits:
          cpus: "12"
    network_mode: host

thank you

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.