Hello ! i have a problem, who can help me ,please give me a demo for Java elasticsearch 2.0

who can help me ,please give me a demo for Java elasticsearch 2.0

What exactly are you after when you talk about a demo?

hello , Is a simple demo about Transport through Client Java and ES communication;

Exception in thread "main" NoNodeAvailableException[None of the configured nodes are available: []]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:280)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:197)
at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:272)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:347)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
at client.ElasticSearchHandler.createIndexResponse(ElasticSearchHandler.java:84)
at client.ElasticSearchHandler.main(ElasticSearchHandler.java:136)

like it it tall me None of the configured nodes are available i dont know hao to do

Please make sure when connect to elastic search you must enter the port to 9300 instead of 9200 with cluster name and ip

I did this, but I don't know where the problem is. The executive order is all but the node, thank you.

This code works for me: https://github.com/dadoonet/legacy-search/blob/01-direct/src/main/java/fr/pilato/demo/legacysearch/dao/ElasticsearchDao.java#L48

Make sure that you set cluster name if you changed it and if you are running your code on another machine that you changed network.host

yes!i am sure changed !thank you very much. i will have a try.

[2015-11-18 13:33:46,955][WARN ][transport.netty ] [Unus the Untouchable] exception caught on transport layer [[id: 0x8c3403c9, /192.168.20.122:64281 => /192.168.20.122:9300]], closing connection
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:225)
at sun.nio.ch.IOUtil.read(IOUtil.java:193)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:375)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

i am sorry,I transferred my service to the local.I know My profile is wrong.Can you teach me? thanks!