Connect to EC2 cluster from other security groups

I've created a cluster with 2 EC2 instances on amazon and set the security group as search-cluster and they are works fine. Then I start another instance which is in security group web-server. Both security groups have port 9200 and 9300 opened.

In this web server i have a web app which contains such code:

Builder settings = ImmutableSettings.settingsBuilder();
settings.put("discovery.type", "ec2");
settings.put("cloud.aws.access_key", "my access key");
settings.put("cloud.aws.secret_key", "my security key");
settings.put("discovery.ec2.groups", "search-cluster");
Node node = nodeBuilder().settings(settings).clusterName("my cluster name").client(true).node();
client = node.client();

Then I got such error when I index a record into the elasticsearch:
org.elasticsearch.discovery.MasterNotDiscoveredException:
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:162)
org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:332)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:636)

Can anyone tell me what can I do to deal with the problem? Thanks

The elasticsearch is version 0.18.7 and java 1.6

Set the org.elasticsearch.discovery to TRACE and you will see which nodes are used to join the cluster. You might need to provide both groups as well in the configuration.

On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com (http://Nabble.com).

Did you mean set the setting in java code? I've tried but didn't see the TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes are used to join the cluster. You might need to provide both groups as well in the configuration.
On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

I provide more info.

  1. I'm running elasticsearch client in amazon's mapreduce process and we were using cascading(www.cascading.org) to help us programming mapreduce programs.
  2. The mapreduct process is running in the same region but different groups: ElasticMapReduce-slave, ElasticMapReduce-master. I've opened port 9200 and 9300 on both of the group
  3. I've changed the log setting and tested locally and trace log has been printed out but it didn't print any trace log after I've upload the package on amazon mapreduce environment.

The attachment is the log we get from the result. Can anyone give any advice?

Thanks,

Ye Zhou

On 2012/02/13, at 15:5 , Ye Zhou wrote:

Did you mean set the setting in java code? I've tried but didn't see the TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes are used to join the cluster. You might need to provide both groups as well in the configuration.
On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Difficult to tell what is happening since you are running from inside
Hadoop. How are you creating the ES client? Are you sure it is created
fully on each Hadoop node?

--
Ivan

On Mon, Feb 13, 2012 at 10:09 PM, Ye Zhou zhouy.vreal@gmail.com wrote:

I provide more info.

  1. I'm running elasticsearch client in amazon's mapreduce process and we
    were using cascading(www.cascading.org) to help us programming mapreduce
    programs.
  2. The mapreduct process is running in the same region but different
    groups: ElasticMapReduce-slave, ElasticMapReduce-master. I've opened port
    9200 and 9300 on both of the group
  3. I've changed the log setting and tested locally and trace log has been
    printed out but it didn't print any trace log after I've upload the package
    on amazon mapreduce environment.

The attachment is the log we get from the result. Can anyone give any
advice?

Thanks,

Ye Zhou

On 2012/02/13, at 15:5 , Ye Zhou wrote:

Did you mean set the setting in java code? I've tried but didn't see the
TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes
are used to join the cluster. You might need to provide both groups as well
in the configuration.

On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Hi,

Here's my code:

Builder settings = ImmutableSettings.settingsBuilder();
settings.put("discovery.type", "ec2");
settings.put("cloud.aws.access_key", "my access key");
settings.put("cloud.aws.secret_key", "my security key");
settings.put("discovery.ec2.groups", "search-cluster");
Node node = nodeBuilder().settings(settings).clusterName("my cluster name").client(true).node();
client = node.client();

Regards,
Ye Zhou

On 2012/02/15, at 2:16 , Ivan Brusic wrote:

Difficult to tell what is happening since you are running from inside
Hadoop. How are you creating the ES client? Are you sure it is created
fully on each Hadoop node?

--
Ivan

On Mon, Feb 13, 2012 at 10:09 PM, Ye Zhou zhouy.vreal@gmail.com wrote:

I provide more info.

  1. I'm running elasticsearch client in amazon's mapreduce process and we
    were using cascading(www.cascading.org) to help us programming mapreduce
    programs.
  2. The mapreduct process is running in the same region but different
    groups: ElasticMapReduce-slave, ElasticMapReduce-master. I've opened port
    9200 and 9300 on both of the group
  3. I've changed the log setting and tested locally and trace log has been
    printed out but it didn't print any trace log after I've upload the package
    on amazon mapreduce environment.

The attachment is the log we get from the result. Can anyone give any
advice?

Thanks,

Ye Zhou

On 2012/02/13, at 15:5 , Ye Zhou wrote:

Did you mean set the setting in java code? I've tried but didn't see the
TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes
are used to join the cluster. You might need to provide both groups as well
in the configuration.

On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Hi,

It sounds solved. At beginning we just opened ports 9200 and 9300 on security groups but now we opened ports from 9200 to 9399. But from the document it seems it just require port 9200 and 9300. Can anyone explain?

Regards,
Ye Zhou

On 2012/02/15, at 8:58 , Ye Zhou wrote:

Hi,

Here's my code:

Builder settings = ImmutableSettings.settingsBuilder();
settings.put("discovery.type", "ec2");
settings.put("cloud.aws.access_key", "my access key");
settings.put("cloud.aws.secret_key", "my security key");
settings.put("discovery.ec2.groups", "search-cluster");
Node node = nodeBuilder().settings(settings).clusterName("my cluster name").client(true).node();
client = node.client();

Regards,
Ye Zhou

On 2012/02/15, at 2:16 , Ivan Brusic wrote:

Difficult to tell what is happening since you are running from inside
Hadoop. How are you creating the ES client? Are you sure it is created
fully on each Hadoop node?

--
Ivan

On Mon, Feb 13, 2012 at 10:09 PM, Ye Zhou zhouy.vreal@gmail.com wrote:

I provide more info.

  1. I'm running elasticsearch client in amazon's mapreduce process and we
    were using cascading(www.cascading.org) to help us programming mapreduce
    programs.
  2. The mapreduct process is running in the same region but different
    groups: ElasticMapReduce-slave, ElasticMapReduce-master. I've opened port
    9200 and 9300 on both of the group
  3. I've changed the log setting and tested locally and trace log has been
    printed out but it didn't print any trace log after I've upload the package
    on amazon mapreduce environment.

The attachment is the log we get from the result. Can anyone give any
advice?

Thanks,

Ye Zhou

On 2012/02/13, at 15:5 , Ye Zhou wrote:

Did you mean set the setting in java code? I've tried but didn't see the
TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes
are used to join the cluster. You might need to provide both groups as well
in the configuration.

On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Only 9200 and 9300 are needed, unless you start several instances on the same machine. Check the log, it logs the ports that are opened.

On Thursday, February 16, 2012 at 10:45 AM, Ye Zhou wrote:

Hi,

It sounds solved. At beginning we just opened ports 9200 and 9300 on security groups but now we opened ports from 9200 to 9399. But from the document it seems it just require port 9200 and 9300. Can anyone explain?

Regards,
Ye Zhou

On 2012/02/15, at 8:58 , Ye Zhou wrote:

Hi,

Here's my code:

Builder settings = ImmutableSettings.settingsBuilder();
settings.put("discovery.type", "ec2");
settings.put("cloud.aws.access_key", "my access key");
settings.put("cloud.aws.secret_key", "my security key");
settings.put("discovery.ec2.groups", "search-cluster");
Node node = nodeBuilder().settings(settings).clusterName("my cluster name").client(true).node();
client = node.client();

Regards,
Ye Zhou

On 2012/02/15, at 2:16 , Ivan Brusic wrote:

Difficult to tell what is happening since you are running from inside
Hadoop. How are you creating the ES client? Are you sure it is created
fully on each Hadoop node?

--
Ivan

On Mon, Feb 13, 2012 at 10:09 PM, Ye Zhou <zhouy.vreal@gmail.com (mailto:zhouy.vreal@gmail.com)> wrote:

I provide more info.

  1. I'm running elasticsearch client in amazon's mapreduce process and we
    were using cascading(www.cascading.org (http://www.cascading.org/)) to help us programming mapreduce
    programs.
  2. The mapreduct process is running in the same region but different
    groups: ElasticMapReduce-slave, ElasticMapReduce-master. I've opened port
    9200 and 9300 on both of the group
  3. I've changed the log setting and tested locally and trace log has been
    printed out but it didn't print any trace log after I've upload the package
    on amazon mapreduce environment.

The attachment is the log we get from the result. Can anyone give any
advice?

Thanks,

Ye Zhou

On 2012/02/13, at 15:5 , Ye Zhou wrote:

Did you mean set the setting in java code? I've tried but didn't see the
TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes
are used to join the cluster. You might need to provide both groups as well
in the configuration.

On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com (http://Nabble.com/).

Thanks,

I found the logs has the info that's why I've tried to open more ports. When we start the Hadoop Mapreduce process it seems started more than one instances on the same machine. I think that's the reason.

Regads,
Bruce Zhou

On 2012/02/17, at 3:49 , Shay Banon wrote:

Only 9200 and 9300 are needed, unless you start several instances on the same machine. Check the log, it logs the ports that are opened.
On Thursday, February 16, 2012 at 10:45 AM, Ye Zhou wrote:

Hi,

It sounds solved. At beginning we just opened ports 9200 and 9300 on security groups but now we opened ports from 9200 to 9399. But from the document it seems it just require port 9200 and 9300. Can anyone explain?

Regards,
Ye Zhou

On 2012/02/15, at 8:58 , Ye Zhou wrote:

Hi,

Here's my code:

Builder settings = ImmutableSettings.settingsBuilder();
settings.put("discovery.type", "ec2");
settings.put("cloud.aws.access_key", "my access key");
settings.put("cloud.aws.secret_key", "my security key");
settings.put("discovery.ec2.groups", "search-cluster");
Node node = nodeBuilder().settings(settings).clusterName("my cluster name").client(true).node();
client = node.client();

Regards,
Ye Zhou

On 2012/02/15, at 2:16 , Ivan Brusic wrote:

Difficult to tell what is happening since you are running from inside
Hadoop. How are you creating the ES client? Are you sure it is created
fully on each Hadoop node?

--
Ivan

On Mon, Feb 13, 2012 at 10:09 PM, Ye Zhou zhouy.vreal@gmail.com wrote:

I provide more info.

  1. I'm running elasticsearch client in amazon's mapreduce process and we
    were using cascading(www.cascading.org) to help us programming mapreduce
    programs.
  2. The mapreduct process is running in the same region but different
    groups: ElasticMapReduce-slave, ElasticMapReduce-master. I've opened port
    9200 and 9300 on both of the group
  3. I've changed the log setting and tested locally and trace log has been
    printed out but it didn't print any trace log after I've upload the package
    on amazon mapreduce environment.

The attachment is the log we get from the result. Can anyone give any
advice?

Thanks,

Ye Zhou

On 2012/02/13, at 15:5 , Ye Zhou wrote:

Did you mean set the setting in java code? I've tried but didn't see the
TRACE log.

On the other hand I've tried to

On 2012/02/13, at 0:43 , Shay Banon wrote:

Set the org.elasticsearch.discovery to TRACE and you will see which nodes
are used to join the cluster. You might need to provide both groups as well
in the configuration.

On Thursday, February 9, 2012 at 9:01 AM, vreal wrote:

The elasticsearch is version 0.18.7 and java 1.6

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Connect-to-EC2-cluster-from-other-security-groups-tp3728579p3728629.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.