elastic / elasticsearch-cloud-aws

AWS Cloud Plugin for Elasticsearch
https://github.com/elastic/elasticsearch/tree/master/plugins/discovery-ec2
575 stars 180 forks source link

Discovery on EC2 not running #244

Open hernan82arg opened 9 years ago

hernan82arg commented 9 years ago

Hi Guys, I've been trying to make this work with no luck.

My config is as follow:

cluster.name: fake node.name: prd-fake-app-01 cloud: aws: access_key: AKIAI24ITOQA4NFAKE secret_key: 7fHOeNoeuzFrnvpKgXj2ac6GL4TkeFAKE region: us-east discovery: type: ec2 groups: sg-8d64fake

IAM user has full access to ec2.

Log looks as follow:

[2015-09-23 22:50:12,058][INFO ][node ] [prd-fake-app-01] initializing ... [2015-09-23 22:50:12,149][INFO ][plugins ] [prd-fake-app-01] loaded [cloud-aws], sites [] [2015-09-23 22:50:12,188][INFO ][env ] [prd-fake-app-01] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [16.6gb], net total_space [19.5gb], types [ext4] [2015-09-23 22:50:15,076][INFO ][node ] [prd-fake-app-01] initialized [2015-09-23 22:50:15,076][INFO ][node ] [prd-fake-app-01] starting ... [2015-09-23 22:50:15,132][INFO ][transport ] [prd-fake-app-01] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.50.1.114:9300]} [2015-09-23 22:50:15,140][INFO ][discovery ] [prd-fake-app-01] erx/2G9PkhMFQVuC7YZyTGWdTw [2015-09-23 22:50:21,165][INFO ][cluster.service ] [prd-fake-app-01] new_master [prd-fake-app-01][2G9PkhMFQVuC7YZyTGWdTw][prd-fake-app-01][inet[/10.50.1.114:9300]], reason: zen-disco-join (elected_as_master) [2015-09-23 22:50:21,182][INFO ][http ] [prd-fake-app-01] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.50.1.114:9200]} [2015-09-23 22:50:21,182][INFO ][node ] [prd-fake-app-01] started [2015-09-23 22:50:21,194][INFO ][gateway ] [prd-fake-app-01] recovered [0] indices into cluster_state

and same thing is happening in the other node.

I've also tried using the name of the security group with no luck.

I've tried plugin version 2.7.0 and 2.7.1 on ES 1.7.0.

I've this working in the same way with ES 1.7.0 and plugin version 2.7.0 Everything is configured in the same way as I'm doing this thru chef.

Is there any way to get the log in debug ? any ideas on what to look?

thanks in advance

danialfaridrocksauce commented 9 years ago

+1 same issue

mausch commented 9 years ago

Same here. I had this working until a few days ago, has Amazon made a breaking change somewhere?

ankon commented 9 years ago

You should be able to enable debugging for discovery using config/logging.yml by uncommenting the line for discovery

mausch commented 9 years ago

In my case I was missing the http.publish_host setting ( https://github.com/elastic/elasticsearch/issues/8137 ) because I was running ES on Docker mapping it to a different port. Weird thing is two out of three nodes could always see each other and one of them (seemed to be random which one) was left out.

Anyway, it was not related to the AWS discovery plugin, sorry.

neonix888 commented 9 years ago

+1

neonix888 commented 9 years ago

Greetings, anyone know what is the work around as only single node is showing up when they should be nodes showing up in a cluster. Thank you for your time.

mausch commented 9 years ago

Scratch my previous comment, it happened again. I had to revert to manual discovery. Nothing relevant came up in the debug logs, I'll post what I have tomorrow.

neonix888 commented 9 years ago

My bad, need to allow 9300. Auto discovered, voila!

imacube commented 9 years ago

@hernan82arg Did you set the following:

discovery.ec2.any_group: false

By default its set to true so the plugin still try's all instances in the region regardless of the security group so the discovery.ec2.groups option won't help.

hernan82arg commented 9 years ago

Nope, I didn't. Will try that the next time. I haven't come back here because after some time it worked (without making any changes). Thanks

mmedin commented 6 years ago

Hey @hernan82arg: You have a small indentation or level error in your config. It's "discovery.ec2.groups", not "discovery.groups". The correct config is:


node.name: prd-fake-app-01
cloud:
   aws:
      access_key: AKIAI24ITOQA4NFAKE
      secret_key: 7fHOeNoeuzFrnvpKgXj2ac6GL4TkeFAKE
      region: us-east
discovery:
   type: ec2
   ec2: 
      groups: sg-8d64fake
      any_group: false