Can't connect to ec2 cluster using node client

Hi Folks,
I have a two node ES cluster at EC2 set up, and I want to connect to
the cluster from my local machine using this code:

    ImmutableSettings.Builder builder =

ImmutableSettings.settingsBuilder();
builder.put("cluster.name", "MyCluster");
builder.put("discovery.zen.multicast.enabled", false);
builder.putArray("discovery.zen.ping.unicast.hosts", "host1",
"host2");//host 1, host2 external EC2 DNS
builder.put("node.local", "false");
Node node =
nodeBuilder().settings(builder).client(true).node();

Unfortunately, what seems to be occurring is that the nodes at EC2 are
sending their internal EC2 ip addresses in ping responses to my local
node and my local node can't respond affirmatively to those ips since
they're EC2 internal. I've tried experimenting with the
transport.publish_host setting on the EC2 servers, but so far no
luck. Any ideas on how this can work? The EC2 discovery module is
not an option for me since my IT department does not want the EC2
account information out in code.

Thanks,
Drew

If you want to connect from your machine to the cluster on ec2, then the network.host should be the public ip. But, its better to use the TransportClient in this case.

On Wednesday, June 15, 2011 at 10:03 PM, Drew H wrote:

Hi Folks,
I have a two node ES cluster at EC2 set up, and I want to connect to
the cluster from my local machine using this code:

ImmutableSettings.Builder builder =
ImmutableSettings.settingsBuilder();
builder.put("cluster.name (http://cluster.name)", "MyCluster");
builder.put("discovery.zen.multicast.enabled", false);
builder.putArray("discovery.zen.ping.unicast.hosts", "host1",
"host2");//host 1, host2 external EC2 DNS
builder.put("node.local", "false");
Node node =
nodeBuilder().settings(builder).client(true).node();

Unfortunately, what seems to be occurring is that the nodes at EC2 are
sending their internal EC2 ip addresses in ping responses to my local
node and my local node can't respond affirmatively to those ips since
they're EC2 internal. I've tried experimenting with the
transport.publish_host setting on the EC2 servers, but so far no
luck. Any ideas on how this can work? The EC2 discovery module is
not an option for me since my IT department does not want the EC2
account information out in code.

Thanks,
Drew

We use Maven to build our projects and our EC2 credentials are part of each
users /.m2/settings.xml file. (At least those users who can deploy to EC2.)
This keeps the credentials out of the codebase and version control.

-- jim

On Wed, Jun 15, 2011 at 3:03 PM, Drew H hite.drew@gmail.com wrote:

Hi Folks,
I have a two node ES cluster at EC2 set up, and I want to connect to
the cluster from my local machine using this code:

   ImmutableSettings.Builder builder =

ImmutableSettings.settingsBuilder();
builder.put("cluster.name", "MyCluster");
builder.put("discovery.zen.multicast.enabled", false);
builder.putArray("discovery.zen.ping.unicast.hosts", "host1",
"host2");//host 1, host2 external EC2 DNS
builder.put("node.local", "false");
Node node =
nodeBuilder().settings(builder).client(true).node();

Unfortunately, what seems to be occurring is that the nodes at EC2 are
sending their internal EC2 ip addresses in ping responses to my local
node and my local node can't respond affirmatively to those ips since
they're EC2 internal. I've tried experimenting with the
transport.publish_host setting on the EC2 servers, but so far no
luck. Any ideas on how this can work? The EC2 discovery module is
not an option for me since my IT department does not want the EC2
account information out in code.

Thanks,
Drew