简体   繁体   English

docker-compose 运行命令:无法成功工作 Windows 10

[英]docker-compose run command: unable to successfully work Windows 10

When I run the command docker-compose up this keeps coming up and is stuck in an infinite loop of it.当我运行命令docker-compose up 时,它不断出现并陷入无限循环。 It starts both services but then it gets stuck at the message about es-03 which I have no idea why its doing that if I do not have it.它启动了这两项服务,但随后卡在有关es-03的消息上,如果我没有它,我不知道为什么要这样做。 Is there something causing this?有什么导致这个吗?

Inside of my docker-compose.yml file I have the following:在我的docker-compose.yml文件中,我有以下内容:

version: '2.2'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic

  kib01: 
    image: docker.elastic.co/kibana/kibana:7.12.1
    container_name: kib01
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_URL: http://es01.9200
      ELASTICSEARCH_HOSTS: http://es01:9200
    networks:
      - elastic

volumes:
  data01:
    driver: local

networks:
   elastic:
     driver: bridge

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

You are trying to start a multi-node cluster, where es01 , es02 and es03 are the nodes, but your docker compose only have the configuration for one node, the es01 node.您正在尝试启动一个多节点集群,其中es01es02es03是节点,但您的 docker 组合只有一个节点的配置,即es01节点。

These two lines tells your es01 node to look for the es02 and es03 nodes to form a cluster.这两行告诉您的es01节点寻找es02es03节点以形成集群。

discovery.seed_hosts=es02,es03
cluster.initial_master_nodes=es01,es02,es03

If you just want a single-node cluster, you need to change your environment in your docker compose, try this.如果你只想要一个单节点集群,你需要在你的 docker 组合中改变你的环境,试试这个。

    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM