Ec2 discovery fundamentals

Hi, I have a couple fundamental questions about the ec2 discovery mechanism
that I wasn't clear on.
Specifically my questions relate to communicating as a client with the java
api.

If I am using NodeBuilder to auto discover ec2 nodes and connect as a
client, like so
settings
.put("cloud.aws.access_key", awsCredentials.getAWSAccessKeyId())
.put("cloud.aws.secret_key", awsCredentials.getAWSSecretKey())
.put("cloud.aws.region", "us-east-1")
.put("discovery.type", "ec2")
.put("discovery.ec2.host_type", "public_ip")
.put("cloud.aws.region","us-east-1")
.put("discovery.ec2.group", "mygroup")
.put("discovery.ec2.tag.esgroup", "mytags");
node = NodeBuilder.nodeBuilder()
.clusterName(clusterName)
.client(true).local(false).data(false)
.settings(settings.build()).node();
client = node.client();

does my client's IP/port need to be accessible by the es ec2 nodes it is
joining?

Second, if I use TransportClient to connect, is there a way to use it along
with ec2 discovery do find transport addresses, or must I explicitly define
them ala
TransportClient tcp = new TransportClient(settings);
client = tcp.addTransportAddress(new InetSocketTransportAddress(indexHost,indexPort
));

Thanks,

-Joe

--

joe wrote:

Hi, I have a couple fundamental questions about the ec2 discovery mechanism
that I wasn't clear on.

[...]

does my client's IP/port need to be accessible by the es ec2 nodes
it is joining?

Yes. A client node interacts with the cluster just like data nodes,
but they can't become master and they don't store data.

Second, if I use TransportClient to connect, is there a way to use it along
with ec2 discovery do find transport addresses, or must I explicitly define
them ala
TransportClient tcp = new TransportClient(settings);
client = tcp.addTransportAddress(new InetSocketTransportAddress(indexHost,indexPort
));

Normally you would need a node to seed your discovery, but with ec2
this may be possible. I haven't tried to run a discovery service
without a running node though. Those classes are dependent upon many
services expected to be available.

However, you can probably reuse some of the cloud plugin code in
AwsEc2UnicastHostsProvider to do some manual discovery before calling
addTransportAddress().

-Drew

--