On AWS, I am connecting to a ES node using Java Transport Client.
The client has security group A
The search node has security group B.
For security group B, I opened all TCP/UDP ports from security group A.
I confirmed that client machine from security group A can query search node
in security group B.
*
*
*curl
http://ec2-some_elastic_ip.compute-1.amazonaws.com:9200/_cluster/health?pretty=true
*
returns valid result
However when I run the Java Client, I get a no node available exception.
org.elasticsearch.client.transport.NoNodeAvailableException: No node
available
- at
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:202) - at
org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106) - at
org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:210) - at
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:388) - at
org.elasticsearch.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:816) - at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:62) - at
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:57)
The odd thing is that, for security group B (ElasticSearch), if I open all
ports to 0.0.0.0/0 instead of security group A, requests from client will
work, and I no longer get the error. However, this is a security flaw since
it allows connection from anywhere.
I know it's possible to connect from A to B since I can CURL to it.
I think it's probably an issue with my Java Client setup. I have my
configuration below, the address specified in java client is the public dns
of the search node after assigning it an elastic ip.
Any guidance will be appreciated.
Cheers,
Fish
------------- Search Node Config
*cluster.name:
cloud:
aws:
access_key:
secret_key:
region: us-east-1
discovery:
type: ec2
ec2:
groups: ElasticSearch
path:
logs: /var/log/elasticsearch
data: /var/data/elasticsearch
network.publish_host: ec2:publicIp
index.number_of_shards: 8
index.number_of_replicas: 1
bootstrap.mlockall: true*
Java Client
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name",
"").build();
transportClient = new TransportClient(settings);
transportClient.addTransportAddress(new InetSocketTransportAddress("ec2-.compute-1.amazonaws.com", 9300));
--
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.
For more options, visit https://groups.google.com/groups/opt_out.