# ClassNotFoundException: org.elasticsearch.discovery.ec2.Ec2DiscoveryModule

**URL:** <https://discuss.elastic.co/t/classnotfoundexception-org-elasticsearch-discovery-ec2-ec2discoverymodule/22254>\
**Category:** Elasticsearch\
**Created:** [February 19, 2015, 12:15am UTC](https://discuss.elastic.co/t/classnotfoundexception-org-elasticsearch-discovery-ec2-ec2discoverymodule/22254 "2015-02-19T00:15:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtuck9](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dtuck9](https://discuss.elastic.co/u/dtuck9)\
**Post date:** [February 19, 2015, 12:15am UTC](https://discuss.elastic.co/t/classnotfoundexception-org-elasticsearch-discovery-ec2-ec2discoverymodule/22254/1 "2015-02-19T00:15:42Z")

</div>

New to ES - Trying to use the elasticsearch-cloud-aws plugin, but when  
starting my java client node, I'm getting ClassNotFoundException  
on org.elasticsearch.discovery.ec2.Ec2DiscoveryModule. Do I need to  
install this plugin on java client nodes, and if so, how does one do that?  
Or, rather, is there a maven dependency that can be referenced to load  
these required classes?

For reference, the elasticsearch.yaml is:

plugin.mandatory: cloud-aws  
cloud:  
aws:  
access\_key: \*\*\*\*\*\*  
secret\_key: \*\*\*\*\*  
discovery:  
type: ec2

and my java client code is:

Settings settings = ImmutableSettings.settingsBuilder()  
.put("node.name", nodeName)  
.put("cloud.aws.access\_key", awsAccessKey)  
.put("cloud.aws.secret\_key", awsSecretKey)  
.put("cloud.node.auto\_attributes", true)  
.put("discovery.type", "ec2")  
.build();  
this.node = nodeBuilder()  
.clusterName(clusterName)  
.settings(settings)  
.client(true)  
.node();  
this.client = node.client();

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 19, 2015, 6:38am UTC](https://discuss.elastic.co/t/classnotfoundexception-org-elasticsearch-discovery-ec2-ec2discoverymodule/22254/2 "2015-02-19T06:38:58Z")

</div>

Yes.

This should be added to the doc: [[Doc] add maven documentation when using with a Java Node Client · Issue #176 · elastic/elasticsearch-cloud-aws · GitHub](https://github.com/elasticsearch/elasticsearch-cloud-aws/issues/176)

You need to add this dependency if you are using a NodeClient:

org.elasticsearch  
elasticsearch-cloud-aws  
2.4.1

HTH  
David

> Le 19 févr. 2015 à 01:15, Diana Tuck [dtuck9@gmail.com](mailto:dtuck9@gmail.com) a écrit :
> 
> New to ES - Trying to use the elasticsearch-cloud-aws plugin, but when starting my java client node, I'm getting ClassNotFoundException on org.elasticsearch.discovery.ec2.Ec2DiscoveryModule. Do I need to install this plugin on java client nodes, and if so, how does one do that? Or, rather, is there a maven dependency that can be referenced to load these required classes?
> 
> For reference, the elasticsearch.yaml is:
> 
> plugin.mandatory: cloud-aws  
> cloud:  
> aws:  
> access\_key: \*\*\*\*\*\*  
> secret\_key: \*\*\*\*\*  
> discovery:  
> type: ec2
> 
> and my java client code is:
> 
> ## Settings settings = ImmutableSettings.settingsBuilder() .put("node.name", nodeName) .put("cloud.aws.access\_key", awsAccessKey) .put("cloud.aws.secret\_key", awsSecretKey) .put("cloud.node.auto\_attributes", true) .put("discovery.type", "ec2") .build(); this.node = nodeBuilder() .clusterName(clusterName) .settings(settings) .client(true) .node(); this.client = node.client();
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/E6E5D8C5-3A9A-46A1-9531-95514F4708BB%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/E6E5D8C5-3A9A-46A1-9531-95514F4708BB%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dtuck9](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dtuck9](https://discuss.elastic.co/u/dtuck9)\
**Post date:** [February 19, 2015, 6:06pm UTC](https://discuss.elastic.co/t/classnotfoundexception-org-elasticsearch-discovery-ec2-ec2discoverymodule/22254/3 "2015-02-19T18:06:52Z")

</div>

Thanks, David. I eventually ended up finding the pom on the github repo.  
Thanks for adding the documentation!!

On Wednesday, February 18, 2015 at 10:39:19 PM UTC-8, David Pilato wrote:

> Yes.
> 
> This should be added to the doc:  
> [[Doc] add maven documentation when using with a Java Node Client · Issue #176 · elastic/elasticsearch-cloud-aws · GitHub](https://github.com/elasticsearch/elasticsearch-cloud-aws/issues/176)
> 
> You need to add this dependency if you are using a NodeClient:
> 
> org.elasticsearch elasticsearch-cloud-aws\</  
> artifactId\>  
> 2.4.1  
> HTH  
> David
> 
> Le 19 févr. 2015 à 01:15, Diana Tuck \<[dtu...@gmail.com](mailto:dtu...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> New to ES - Trying to use the elasticsearch-cloud-aws plugin, but when  
> starting my java client node, I'm getting ClassNotFoundException  
> on org.elasticsearch.discovery.ec2.Ec2DiscoveryModule. Do I need to  
> install this plugin on java client nodes, and if so, how does one do that?  
> Or, rather, is there a maven dependency that can be referenced to load  
> these required classes?
> 
> For reference, the elasticsearch.yaml is:
> 
> plugin.mandatory: cloud-aws  
> cloud:  
> aws:  
> access\_key: \*\*\*\*\*\*  
> secret\_key: \*\*\*\*\*  
> discovery:  
> type: ec2
> 
> and my java client code is:
> 
> Settings settings = ImmutableSettings.settingsBuilder()  
> .put("node.name", nodeName)  
> .put("cloud.aws.access\_key", awsAccessKey)  
> .put("cloud.aws.secret\_key", awsSecretKey)  
> .put("cloud.node.auto\_attributes", true)  
> .put("discovery.type", "ec2")  
> .build();  
> this.node = nodeBuilder()  
> .clusterName(clusterName)  
> .settings(settings)  
> .client(true)  
> .node();  
> this.client = node.client();
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/925353fd-b717-417d-986f-570c634e39c1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3fc41382-3521-416d-8052-50f342462816%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3fc41382-3521-416d-8052-50f342462816%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:31am UTC](https://discuss.elastic.co/t/classnotfoundexception-org-elasticsearch-discovery-ec2-ec2discoverymodule/22254/4 "2017-07-06T00:31:29Z")

</div>


