Hey All,
I think this has got to be not setting up the Java API correctly.
Have a box in ec2 that is running elasticsearch.
locally, can get cluster status and health, and docs, etc.
my my local dev, connecting to that box, using a basic get
I can get cluster health/status, add docs, etc.
basically, I make a Java URL and do a get:
(hacked example):
URL urlPage = new URL(strUrl);
HttpURLConnection urlConnection =
(HttpURLConnection)urlPage.openConnection();
However, when I try doing the same things with a TransportClient, I
just hang there (if I use port 9200) or get No Node available (if I
used port 9300)
Help on the transportclient setup would be much appreciated, because
all other methods of connecting seem to work fine.
Using TransportClient, you should use port 9300, not 9200. If you talk
remotely to an ec2 instance, you might not want to set sniff to true, this
is because the publish address of the node might be the private IP, while
you want to connect over the public IP (when sniff is set to true, the node
publish IP is used to talk to it). Also, is port 9300 open?
Hey All,
I think this has got to be not setting up the Java API correctly.
Have a box in ec2 that is running elasticsearch.
locally, can get cluster status and health, and docs, etc.
my my local dev, connecting to that box, using a basic get
I can get cluster health/status, add docs, etc.
basically, I make a Java URL and do a get:
(hacked example):
URL urlPage = new URL(strUrl);
HttpURLConnection urlConnection =
(HttpURLConnection)urlPage.openConnection();
However, when I try doing the same things with a TransportClient, I
just hang there (if I use port 9200) or get No Node available (if I
used port 9300)
Help on the transportclient setup would be much appreciated, because
all other methods of connecting seem to work fine.
yes, port 9300 also needs to be used when setting up the
transportclient.
here was the last one.
when building and getting the clusterhealthrequest
i had this, which is what the javadoc said you could do:
ClusterHealthRequest chr =
Requests.clusterHealthRequest((String)null);
however, that causes a nullpointerexception in some .writeUTF
if you change it to:
ClusterHealthRequest chr = Requests.clusterHealthRequest("");
then it works fine and the request will then work.
Using TransportClient, you should use port 9300, not 9200. If you talk
remotely to an ec2 instance, you might not want to set sniff to true, this
is because the publish address of the node might be the private IP, while
you want to connect over the public IP (when sniff is set to true, the node
publish IP is used to talk to it). Also, is port 9300 open?
Hey All,
I think this has got to be not setting up the Java API correctly.
Have a box in ec2 that is running elasticsearch.
locally, can get cluster status and health, and docs, etc.
my my local dev, connecting to that box, using a basic get
I can get cluster health/status, add docs, etc.
basically, I make a Java URL and do a get:
(hacked example):
URL urlPage = new URL(strUrl);
HttpURLConnection urlConnection =
(HttpURLConnection)urlPage.openConnection();
However, when I try doing the same things with a TransportClient, I
just hang there (if I use port 9200) or get No Node available (if I
used port 9300)
Help on the transportclient setup would be much appreciated, because
all other methods of connecting seem to work fine.
yes, port 9300 also needs to be used when setting up the
transportclient.
here was the last one.
when building and getting the clusterhealthrequest
i had this, which is what the javadoc said you could do:
ClusterHealthRequest chr =
Requests.clusterHealthRequest((String)null);
however, that causes a nullpointerexception in some .writeUTF
if you change it to:
ClusterHealthRequest chr = Requests.clusterHealthRequest("");
then it works fine and the request will then work.
Using TransportClient, you should use port 9300, not 9200. If you talk
remotely to an ec2 instance, you might not want to set sniff to true,
this
is because the publish address of the node might be the private IP, while
you want to connect over the public IP (when sniff is set to true, the
node
publish IP is used to talk to it). Also, is port 9300 open?
Hey All,
I think this has got to be not setting up the Java API correctly.
Have a box in ec2 that is running elasticsearch.
locally, can get cluster status and health, and docs, etc.
my my local dev, connecting to that box, using a basic get
I can get cluster health/status, add docs, etc.
basically, I make a Java URL and do a get:
(hacked example):
URL urlPage = new URL(strUrl);
HttpURLConnection urlConnection =
(HttpURLConnection)urlPage.openConnection();
However, when I try doing the same things with a TransportClient, I
just hang there (if I use port 9200) or get No Node available (if I
used port 9300)
Help on the transportclient setup would be much appreciated, because
all other methods of connecting seem to work fine.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.