0

I am trying to setup elasticsearch on 2 ec2 nodes. I have the plugin installed and my config has the following:

cloud:
    aws:
        access_key: KEY
        secret_key: KEY

discovery:
    type: ec2
    ec2:
        groups: security-group

They only discover if I have both this specified and an EIP assigned to each one. Why do I need an EIP assigned? A while ago I had a NAT instance and I did not need the EIP nor the cloud: etc in the config.

Paige Cook
  • 22,415
  • 3
  • 57
  • 68
Gabriel
  • 575
  • 2
  • 8
  • 20
  • Error I am getting is: Full exception: com.amazonaws.AmazonClientException: Unable to execute HTTP request: Connect to ec2.amazonaws.com/ec2.amazonaws.com/72.21.215.33 timed out – Gabriel Jan 08 '14 at 19:36

2 Answers2

0

We had some issues with getting nodes within the cluster to see each other in an AWS EC2 setup. We were seeing a timeout issue as well. It turned out that we had added a self-reference to the security group (within the AWS console) in order to get the instances to see each other.

E.g. within the security group settings have the following entry:

TCP Port(Service)    Source
0 - 65535            sg-xxxxx (security-group)

Once we added this the discovery worked as expected.

Nathan Smith
  • 8,271
  • 3
  • 27
  • 44
Paige Cook
  • 22,415
  • 3
  • 57
  • 68
  • Do you mean the SG for ES instances I am using? They can see each other only if I add the AWS keys which I'd rather avoid if possible. – Gabriel Jan 09 '14 at 17:58
0

Try use this config

cloud:
    aws:
        access_key: KEY
        secret_key: KEY

discovery:
    type: ec2
    ec2:
        groups: security-group
        availability_zones: ap-southeast-1a,ap-southeast-1b
        tag: 
            stage: production

And add Tag "stage" to Instances PS. security-group which security group assign to instances

Poom
  • 36
  • 2
  • I'm using a similar config, it's working but I also noticed in the logs it is trying to connect to other servers in EC2 that are not in that security group and do no have ES running. I'm not sure why. Is the AWS keys absolutely required? – Gabriel Jan 13 '14 at 19:57