Can connect with http, but NOT through Java API

Just answering to : How do I know what version of ES I'm running on the server? Is there a HTTP REST API for that?

Yes! curl http://localhost:9200

Easy, isn't it?

:wink:

--

Le 16 août 2012 à 23:05, "P. Hill" parehill1@gmail.com a écrit :

Do you have any Lucene libraries in your classpath

I was thinking that was most likely the answer since I have a combination of Eclipse projects and I was trying to get a Maven copy of ES to combine with,
but after linking my Lucene project to ES libraries and it failing I went back to a simplier setup.

I created a new project that depended on the Maven of ES (containing Lucene 3.6) and compiled everything using JDK 1.60._25 and I still have the problem :slight_smile:

How do I know what version of ES I'm running on the server? Is there a HTTP REST API for that?
How do I know what version of the code I'm running in my project?

Version.java says
public static final Version CURRENT = V_0_20_0_Beta1;

The following code also can't build a node to join the cluster as stated on
Elasticsearch Platform — Find real-time answers at scale | Elastic

Could it be because either of the following (which I thought matched the API failing
http://172.16.0.164:9200/_cluster/nodes/state?pretty=true
OR
http://172.16.0.164:9200/_cluster/nodes/status?pretty=true
Returns no nodes?

{
"ok" : true,
"cluster_name" : "metajure",
"nodes" : {
}
}

But
http://172.16.0.164:9200/_cluster/state?pretty=true
Does return lots of information.


public class Foo {

/**
* @return
*/
public static Settings buildSettings() {
Settings settings;
// once we find one node in the cluster ask about the others
Builder settingsBuilder = ImmutableSettings.settingsBuilder().put("client.transport.sniff", true);
settingsBuilder.put("cluster.name", "metajure");
settingsBuilder.put("client.transport.ping_timeout", "10s");
settings = settingsBuilder.build();
return settings;
}

public static void main(String args) throws InterruptedException {
new TransportClient(buildSettings()).addTransportAddress(new InetSocketTransportAddress("172.16.0.164", 9300));

   Node node = nodeBuilder().settings(buildSettings()).node();
   Client client = node.client();

   Thread.currentThread().sleep(5000);

}
}


-Paul

--

--