title: discovery of ec2 on elasticsearch
body: <p>Here is my elasticsearch configuration (elasticsearch.yml file.</p>
  
  <pre><code>**cluster:
    name: demo.elasticsearch.com
  
  node:
    name: node1
  
  discovery:
  
  type: ec2
  
  ec2:
  
  groups: elastic-search
  
  host_type: private_dns
  
  ping_timeout: 5s
  
  gateway:
  
  type: s3
  
  s3:
  
  bucket: elastic-search-demo
  
  cloud:
  
  aws:
  
  access_key: A*************4M
  
  secret_key: sT********************lmn8
  
  region: us-east-1**
  </code></pre>
  
  <p>I installed elastic search and cloud-aws plugin and I have two instances in the same <strong>aws account</strong> in <strong>us-east-1d</strong> with security group <strong>elastic-search</strong>. Security group are configured with <strong>9300-9400 ports</strong> enabled for <strong>TCP connection</strong>.</p>
  
  <p>When I start elastic search on one instance, it elect itself as a master, things are going as desired upto here. <strong>But when I start elastic search on another instance, it could not discover first ec2 instance and elect itself as a master</strong>.</p>
  
  <p>I did lots of googling but with no help. Please get me out of the problem. </p>