Can't get Java client to join cloud-aws cluster

I have an elasticsearch instance running on an EC2 machine with the
following elasticsearch.yml:

cluster.name: test

plugin.mandatory: cloud-aws

cloud:
aws:
access_key: xxxxxxxxxxxx
secret_key: xxxxxxxxxxxx
region: us-east-1

discovery:
type: ec2

The instance seems to be fine; curl localhost:9200/_cluster/health? pretty=true returns:

{
"cluster_name" : "test",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}

Here's how I try to connect to the cluster from my application:

ImmutableSettings.Builder settings =
ImmutableSettings.settingsBuilder()
.put("cloud.aws.access_key", "xxxxxxxxxxxx")
.put("cloud.aws.secret_key", "xxxxxxxxxxxx")
.put("cloud.aws.region", "us-east-1")
.put("discovery.type", "ec2");

return NodeBuilder.nodeBuilder()
.clusterName("test")
.client(true).local(false)
.settings(settings.build()).node();

But I get the following error after 30s--even when running on the same
machine:

[warn] o.e.discovery - [Venomm] waited for 30s and no initial state
was set by the discovery

Any ideas what I'm missing?

Did you open 9300 port on your EC2 instance ?

David

Le 22 mai 2012 à 04:06, Eric Jain eric.jain@gmail.com a écrit :

I have an elasticsearch instance running on an EC2 machine with the
following elasticsearch.yml:

cluster.name: test

plugin.mandatory: cloud-aws

cloud:
aws:
access_key: xxxxxxxxxxxx
secret_key: xxxxxxxxxxxx
region: us-east-1

discovery:
type: ec2

The instance seems to be fine; curl localhost:9200/_cluster/health? pretty=true returns:

{
"cluster_name" : "test",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}

Here's how I try to connect to the cluster from my application:

ImmutableSettings.Builder settings =
ImmutableSettings.settingsBuilder()
.put("cloud.aws.access_key", "xxxxxxxxxxxx")
.put("cloud.aws.secret_key", "xxxxxxxxxxxx")
.put("cloud.aws.region", "us-east-1")
.put("discovery.type", "ec2");

return NodeBuilder.nodeBuilder()
.clusterName("test")
.client(true).local(false)
.settings(settings.build()).node();

But I get the following error after 30s--even when running on the same
machine:

[warn] o.e.discovery - [Venomm] waited for 30s and no initial state
was set by the discovery

Any ideas what I'm missing?

On Mon, May 21, 2012 at 9:59 PM, David Pilato david@pilato.fr wrote:

Did you open 9300 port on your EC2 instance ?

Thanks, that was indeed the issue. Hadn't thought I'd need to open any
ports to make this work on a single machine...

btw I had to open ports 9300-9400 within the ec2 security group to
avoid subsequent errors; couldn't find any mention of this in the docs
or in Elasticsearch Platform — Find real-time answers at scale | Elastic

Opening just 9300 is enough, unless you run more than one ES instance on
that node (in which case the additional nodes will start ot use port 9301,
9302, and so on).

On Tue, May 22, 2012 at 8:47 AM, Eric Jain eric.jain@gmail.com wrote:

On Mon, May 21, 2012 at 9:59 PM, David Pilato david@pilato.fr wrote:

Did you open 9300 port on your EC2 instance ?

Thanks, that was indeed the issue. Hadn't thought I'd need to open any
ports to make this work on a single machine...

btw I had to open ports 9300-9400 within the ec2 security group to
avoid subsequent errors; couldn't find any mention of this in the docs
or in
Elasticsearch Platform — Find real-time answers at scale | Elastic

On Wed, May 23, 2012 at 3:51 PM, Shay Banon kimchy@gmail.com wrote:

Opening just 9300 is enough, unless you run more than one ES instance on
that node (in which case the additional nodes will start ot use port 9301,
9302, and so on).

I was running a single elasticsearch standalone instance per machine +
a Java application that creates a Node with client(true).

A node client also opens a transport channel...

On Thu, May 24, 2012 at 2:37 AM, Eric Jain eric.jain@gmail.com wrote:

On Wed, May 23, 2012 at 3:51 PM, Shay Banon kimchy@gmail.com wrote:

Opening just 9300 is enough, unless you run more than one ES instance on
that node (in which case the additional nodes will start ot use port
9301,
9302, and so on).

I was running a single elasticsearch standalone instance per machine +
a Java application that creates a Node with client(true).