# Org.elasticsearch.client.transport.NoNodeAvailableException: No node available --- while using Java API for Indexing into Linux Server from my Local System

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-client-transport-nonodeavailableexception-no-node-available-while-using-java-api-for-indexing-into-linux-server-from-my-local-system/11614>\
**Category:** Elasticsearch\
**Created:** [April 17, 2013, 10:44am UTC](https://discuss.elastic.co/t/org-elasticsearch-client-transport-nonodeavailableexception-no-node-available-while-using-java-api-for-indexing-into-linux-server-from-my-local-system/11614 "2013-04-17T10:44:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad\_rafi\_g](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mohammad\_rafi\_g](https://discuss.elastic.co/u/mohammad_rafi_g)\
**Post date:** [April 17, 2013, 10:44am UTC](https://discuss.elastic.co/t/org-elasticsearch-client-transport-nonodeavailableexception-no-node-available-while-using-java-api-for-indexing-into-linux-server-from-my-local-system/11614/1 "2013-04-17T10:44:08Z")

</div>

Hi., to all.

```
 I am trying to Index Some Documents into our Server System(running 

```

Linux) from my Local System(running in Windows 7).  
I am using Winscp for file transformation between my Local System and  
Srever System. And Putty for Communicating(for running commands to index  
documents) with Server System.

In Putty(Running from my Local System and connected with Server), I have  
tried the following.,  
curl xxx.xxx.xxx.251:9200  
{  
"ok" : true,  
"status" : 200,  
"name" : "e257-1",  
"version" : {  
"number" : "0.20.5",  
"snapshot\_build" : false  
},  
"tagline" : "You Know, for Search"  
}  
--- That means Elasticsearch is working fine.  
And  
curl -XPOST [http://xxx.xxx.xxx.251:9200/test/testing/01](http://xxx.xxx.xxx.251:9200/test/testing/01) -d  
'{"name":"adward"}'  
{"ok":true,"\_index":"test","\_type":"testing","\_id":"01","\_version":1}  
----That means I am able to Indexing using CURL Command from Putty.

But.,  
When I am using Elaasticsearch-java-api., The Sample Code is Given below  
...............................................................................................................  
Settings settings =  
ImmutableSettings.settingsBuilder().put("cluster.name",  
"elasticsearch257").build();  
Client client = new TransportClient(settings).addTransportAddress(new  
InetSocketTransportAddress("xxx.xxx.xxx.251", 9300));

```
IndexResponse response = client.prepareIndex("twitter", "tweet", 

```

"1").setSource(  
jsonBuilder().startObject().field("user",  
"kimchy").field("message", "trying out Elastic Search").endObject()  
).execute().actionGet();

```
client.close();

```

................................................................................................................................  
And I have Created one Runnable Jar file and place it in My Server System  
File System using WINSCP and  
I have Run that jar file, using Putty(from my Local System){connected to my  
Server system}, using following command.,

java -cp sampleIndex.jar test.index.SampleIndex  
// where sampleIndex.jar is runnable jar exported from SampleIndex.java  
file and test.index is package name

Then -- I am getting the following Exception  
org.elasticsearch.transport.NodeDisconnectedException:  
[][inet[/192.168.2.251:9300]][cluster/nodes/info] disconnected  
Exception in thread "main"  
org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available

Can Any One Tell me, What I Have Done Wrong With My Code/Procedure?

Please Any One Tell me(share code to connect with server from my local  
system),  
How to Index Documents(push data) into My Server System(running under Linux  
with IP address say., xxx.xxx.xxx.251) from My Local System(running in  
windows 7 with ip address xxx.xxx.xxx.182) using Java API.

Thanks to you all.  
Regards  
Rafi

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:40am UTC](https://discuss.elastic.co/t/org-elasticsearch-client-transport-nonodeavailableexception-no-node-available-while-using-java-api-for-indexing-into-linux-server-from-my-local-system/11614/2 "2017-07-06T02:40:50Z")

</div>

Closed on July 6, 2017, 2:40am UTC


