title: Elastic nodes not sharing data?
body: <p>HI Currently I am using docker compose to spin up two instances of elastic containers and networking between them.</p>
  
  <p>In one of the elastic containers i am executing a bulk api request to insert some documents to an index. </p>
  
  <p>however the problem is when i separately logs into each elastic container and execute a curl command on of them shows the result and other not .</p>
  
  <pre><code>Prasanths-MacBook-Air:api kannan$ docker ps
  CONTAINER ID        IMAGE                                                 COMMAND                  CREATED             STATUS              PORTS                              NAMES
  798c06a9907b        docker_elasticsearch2                                 "/docker-entrypoint.…"   8 minutes ago       Up 8 minutes        9200/tcp, 9300/tcp                 elasticsearch2
  336e58a46217        docker.elastic.co/elasticsearch/elasticsearch:6.6.1   "/usr/local/bin/dock…"   8 minutes ago       Up 8 minutes        0.0.0.0:9200-&gt;9200/tcp, 9300/tcp   elasticsearch
  </code></pre>
  
  <p>Now login on try curl command for listing each indices on each container</p>
  
  <pre><code>Prasanths-MacBook-Air:api kannan$ docker exec -it 798c06a9907b curl '127.0.0.1:9200/_cat/indices?v&amp;pretty'
  health status index uuid                   pri rep docs.count docs.deleted store.size pri.store.size
  yellow open   test  z27UBFUWTfC3E-xFFDhLOQ   5   1          0            0      1.2kb          1.2kb
  yellow open   cars  R5mvqQk2RkuspNQ6o02E4g   5   1        833            0    491.6kb        491.6kb
  </code></pre>
  
  <p>Now trying the following</p>
  
  <pre><code>Prasanths-MacBook-Air:api kannan$ docker exec -it 336e58a46217 curl '127.0.0.1:9200/_cat/indices?v&amp;pretty'
  health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
  </code></pre>
  
  <p>This is my docker compose file named elasticsearch.yml using the following command </p>
  
  <pre><code>docker-compose -f src/main/docker/elasticsearch.yml up
  </code></pre>
  
  <p>this is the content of the file elasticsearch.yml</p>
  
  <pre><code>version: '2.0'
  services:
    elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch:6.6.1
      container_name: elasticsearch
      environment:
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      ulimits:
        memlock:
          soft: -1
          hard: -1
      volumes:
        - esdata1:/usr/share/elasticsearch/data
      ports:
        - 9200:9200
      networks:
        - esnet
    elasticsearch2:
      build:
          context: .
          dockerfile: elasticsearch/elasticsearch-Migration.Dockerfile
      container_name: elasticsearch2
      environment:
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        - "discovery.zen.ping.unicast.hosts=elasticsearch"
        - network.host=0.0.0.0
      ulimits:
        memlock:
          soft: -1
          hard: -1
      volumes:
        - esdata2:/usr/share/elasticsearch/data
      networks:
        - esnet
  
  volumes:
    esdata1:
      driver: local
    esdata2:
      driver: local
  
  networks:
    esnet:
  </code></pre>
  
  <p>any idea why is the indices not listed properly when i execute a curl command on container elasticsearch and it works fine for container elasticsearch2</p>
  
  <p>thank you so much</p>