Commit d5808e08 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige conexión keepAlive, borra restos

Usa modo "dnsrr" para comunicar los servicios con las tareas lanzadas.
De esta manera, se evita una rotura de las conexiones tras 15 minutos,
límite impuesto por el balanceador integrado de Docker Swarm.

Elimina ficheros compose olvidados de versiones anteriores.
parent fc66afd6
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
version: '3.5'

services:
  elasticsearch-1:
    environment:
      - ES_JAVA_OPTS=-Xms512m -Xmx512m -Djava.security.policy=file:///usr/share/elasticsearch/config/grovy-classes_whitelist.policy
      - ES_CLUSTER_NAME=elasticsearch_dev
      - ES_NODE_NAME=node-1
      - ES_DISCOVERY_ZEN_MINIMUM_MASTER_NODES=1
      - ES_DISCOVERY_ZEN_PING_UNICAST_HOSTS=elasticsearch-1
      - ES_XPACK_SECURITY_ENABLED=true
    ports:
      - target: ${PORT1}
        published: ${PORT1}
        mode: host
      - target: ${PORT2}
        published: ${PORT2}
        mode: host
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 1G
        reservations:
          cpus: '0.2'
          memory: 820M

volumes:
  elasticsearch-vol:
    name: ${ELASTICSEARCH_VOL_NAME:-elasticsearch-reloaded-vol}
+0 −37
Original line number Diff line number Diff line
version: '3.5'

services:
  elasticsearch-1:
    environment:
      - ES_JAVA_OPTS=-Xms1g -Xmx1g -Djava.security.policy=file:///usr/share/elasticsearch/config/grovy-classes_whitelist.policy
      - ES_CLUSTER_NAME=redmic
      - ES_NODE_NAME={{.Service.Name}}
      - ES_DISCOVERY_ZEN_PING_UNICAST_HOSTS=['elasticsearch-1', 'elasticsearch-2', 'elasticsearch-3']
      - USER_MANAGEMENT_DELAY=200
      - ES_XPACK_SECURITY_ENABLED
    healthcheck:
      test: curl --silent localhost:${PORT1}/_cluster/health
      timeout: 10s
      retries: 3
      start_period: 2m
    deploy:
      placement:
        constraints:
          - node.role == worker
          - engine.labels.availability_zone == ${AWS_REGION}a
      resources:
        limits:
          cpus: '1'
          memory: 2G
        reservations:
          cpus: '0.2'
          memory: 1639M

volumes:
  elasticsearch-vol:
    name: "elasticsearch-1-vol"
    driver: "cloudstor:aws"
    driver_opts:
      backing: relocatable
      size: 25
      ebstype: gp2
+0 −32
Original line number Diff line number Diff line
version: '3.5'

services:
  elasticsearch-1:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    networks:
      elastic-net:
        aliases:
          - es-1
    volumes:
      - elasticsearch-vol:/usr/share/elasticsearch/data
    environment:
      - ES_BOOTSTRAP_MEMORY_LOCK=true
      - ES_PLUGINS
      - OLD_ELASTIC_ADMIN_PASS
      - ELASTIC_ADMIN_PASS
      - ELASTIC_USER
      - ELASTIC_USER_PASS
      - ELASTIC_USER_ROLE
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: on-failure
        delay: 10s
        window: 3m

networks:
  elastic-net:
    external: true
+0 −18
Original line number Diff line number Diff line
version: '3.5'

services:
  elasticsearch-2:
    healthcheck:
      test: curl --silent localhost:${PORT1}/_cluster/health
      timeout: 10s
      retries: 3
      start_period: 2m

volumes:
  elasticsearch-vol:
    name: "elasticsearch-2-vol"
    driver: "cloudstor:aws"
    driver_opts:
      backing: relocatable
      size: 25
      ebstype: gp2
+0 −49
Original line number Diff line number Diff line
version: '3.5'

services:
  elasticsearch-2:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    networks:
      elastic-net:
        aliases:
          - es-2
    volumes:
      - elasticsearch-vol:/usr/share/elasticsearch/data
    environment:
      - ES_JAVA_OPTS=-Xms1g -Xmx1g -Djava.security.policy=file:///usr/share/elasticsearch/config/grovy-classes_whitelist.policy
      - ES_CLUSTER_NAME=redmic
      - ES_NODE_NAME={{.Service.Name}}
      - ES_DISCOVERY_ZEN_PING_UNICAST_HOSTS=['elasticsearch-1', 'elasticsearch-2', 'elasticsearch-3']
      - USER_MANAGEMENT_DELAY=200
      - ES_XPACK_SECURITY_ENABLED
      - ES_BOOTSTRAP_MEMORY_LOCK=true
      - ES_PLUGINS
      - OLD_ELASTIC_ADMIN_PASS
      - ELASTIC_ADMIN_PASS
      - ELASTIC_USER
      - ELASTIC_USER_PASS
      - ELASTIC_USER_ROLE
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == worker
          - engine.labels.availability_zone == ${AWS_REGION}b
      restart_policy:
        condition: on-failure
        delay: 10s
        window: 3m
      resources:
        limits:
          cpus: '1'
          memory: 2G
        reservations:
          cpus: '0.2'
          memory: 1639M

networks:
  elastic-net:
    external: true
Loading