EC2 discovery plugin

ES 9.1.2

Using the EC2 discovery plugin with the following config:

network.host: _ec2_
        node.roles: [ "master" ]
        discovery.seed_providers: ec2
        discovery.ec2.tag.ESRole: master
        discovery.ec2.host_type: private_ip
        discovery.ec2.endpoint: ec2.eu-west-1.amazonaws.com
        discovery.ec2.availability_zones: eu-west-1a
        cluster.initial_master_nodes:
          - master-0

Getting the error:

[o.e.d.e.AwsEc2SeedHostsProvider] [master-0] Exception while retrieving instance list from AWS API: protocol must not be null.

The docs state that this has a default value so I have not set:

discovery.ec2.protocol

Hello @brjisc

As per the documentation :

discovery.ec2.endpoint
The EC2 service endpoint to which to connect. See https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region to find the appropriate endpoint for the region. This setting defaults to ec2.us-east-1.amazonaws.com which is appropriate for clusters running in the us-east-1 region.

It seems you need to add protocol you are using in the endpoint :

protocol://service-code.region-code.amazonaws.com

Thanks!!

1 Like

Hmm the docs for discovery.ec2.endpoint say:

This setting defaults to ec2.us-east-1.amazonaws.com which is appropriate for clusters running in the us-east-1 region.

I do not think this is true, at least not in 9.1+. Does it work to drop this setting entirely? I would expect the SDK to be able to detect that it’s running in eu-west-1 and thus use the right endpoint automatically.

If you confirm that it works without this setting, I’ll update the docs. If not, what @Tortoise said is right, you need to say https://ec2.eu-west-1.amazonaws.com instead.

I have added the protocol to the endpoint and the cluster now forms correctly.

Sure, but could you try it without discovery.ec2.endpoint too? It shouldn’t be necessary to set this.

I will test this next week.

1 Like