1
votes

I am having issues with making clusters on AWS using ElasticSearch:

Software: ES: elasticsearch-1.4.1.zip

AWS-Cloud: elasticsearch-cloud-aws/2.4.1

And that is being run on AWS EC2 Micro instance (Ubuntu 64). Both Instances use same security group with everything open, no restrictions at all I have created two instances in us-west Oregon (us-west-2b) and I am using this configuration file:

{
  "cluster.name": "mycluster",
  "http": {
    "cors.enabled" : true,
    "cors.allow-origin": "*"
},
   "node.name": "LosAngeles-node",
   "node.master": "false",
  "cloud": {
    "aws": {
      "access_key": "xxxxxxxxxxxx",
      "secret_key": "xxxxxxxxxxxxxxxxxxxx",
      "region": "us-west"      
    }
  },
  "discovery": {
    "type": "ec2",
          "ec2" : {
        "groups": "esallaccess"
   },
   "zen": {
       "ping": {
          "multicast": {
             "enabled": "false"
              }
          }
      }
 }
}

The LosAngeles node should be a work horse for the cluster, thus node.master = false. When I start this node it constantly pings and never stops pinging, this is in the log after I start it:

...
[2014-11-28 15:18:30,593][TRACE][discovery.ec2            ] [LosAngeles-node] building dynamic  
unicast discovery nodes...

[2014-11-28 15:18:30,593][DEBUG][discovery.ec2            ] [LosAngeles-node] using dynamic   
discovery nodes []

[2014-11-28 15:18:32,170][TRACE][discovery.ec2            ] [LosAngeles-node] building dynamic 
unicast discovery nodes...

[2014-11-28 15:18:32,170][DEBUG][discovery.ec2            ] [LosAngeles-node] using dynamic 
discovery nodes []

[2014-11-28 15:18:32,170][TRACE][discovery.ec2            ] [LosAngeles-node] full ping responses: 
{none}

[2014-11-28 15:18:32,170][DEBUG][discovery.ec2            ] [LosAngeles-node] filtered ping 
responses: (filter_client[true], filter_data[false]) {none}

[2014-11-28 15:18:32,170][TRACE][discovery.ec2            ] [LosAngeles-node] starting to ping
...
enter code here

I am thinking this is problem with region. Any help is appreciated.

PS Master node (NewYork) has the same configuration file with different name and node.master = true

2

2 Answers

1
votes

Try to add master node address into the new node configuration.

In elasticsearch.yml Verify the following parameters:

cluster.name: your-cluster-name
node.master: false
node.data: false
discovery.zen.ping.timeout: 3s
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["your-master.dns.domain.com"]

If you use multicast, disable it. It doesn't work in AWS EC2 For any case check your Security Group.

1
votes

It is required to allow your instances to acquire information about each other to discover available clusters in order for your nodes to find the cluster to join.

The AWS-cloud plugin automatically handles the joining of a node into a cluster once a master is nominated.

setting a Discovery Permission as a policy and apply it to your IAM role should fix this. Here goes the policy I used:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "whatever",
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "ec2:DescribeAvailabilityZones",
                "ec2:DescribeInstances",
                "ec2:DescribeRegions",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeTags"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}