# Transport.tcp.port doesn't work for localhost?

**URL:** <https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743>\
**Category:** Elasticsearch\
**Created:** [April 1, 2014, 4:52pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743 "2014-04-01T16:52:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 1, 2014, 4:52pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/1 "2014-04-01T16:52:41Z")

</div>

I've the following problem: to do an integration test, I set up an embedded  
node and then I create a TransportClient to connect to it.

The setup of the embedded node is (among other things):

port = 11547; // User ports range 1024 - 49151  
tcpport = 9300;  
settings.put("http.port", port);  
settings.put("transport.tcp.port", tcpport);

```
    Settings esSettings = settings.build();

    node = NodeBuilder.nodeBuilder().local(true).settings(esSettings).

```

node(); //I tried setting local to false too  
node.start();

and the transportclient is as simple as:

TransportClient client = new TransportClient();  
client.addTransportAddress(new InetSocketTransportAddress(  
"localhost", 9300));

```
    client.prepareIndex("test", "type").setSource("field", "value").

```

execute().actionGet();

(I tried both localhost and 127.0.0.1).

Anyway I get a connection refused when running the above code:

Caused by: java.net.ConnectException: Connection refused: localhost/127.0.  
0.1:9300  
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(  
NioClientBoss.java:150)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
processSelectedKeys(NioClientBoss.java:105)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(  
NioClientBoss.java:79)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.  
run(AbstractNioSelector.java:318)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(  
NioClientBoss.java:42)  
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(  
ThreadRenamingRunnable.java:108)  
at org.elasticsearch.common.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)  
[2014-04-01 17:48:10,836][TRACE][org.elasticsearch.transport.netty] [Cap 'N  
Hawk] connect exception caught on transport layer [[id: 0x9526b405]]  
java.net.ConnectException: Connection refused: localhost/127.0.0.1:9300  
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)  
at  
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at  
org.elasticsearch.common.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)

my colleague was successful when he tried to connect to another host. but  
he fails with localhost.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a8c21baf-4d41-4d43-b695-660dbba85623%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a8c21baf-4d41-4d43-b695-660dbba85623%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [April 1, 2014, 8:48pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/2 "2014-04-01T20:48:06Z")

</div>

This usually means that there is no local server bound to that port. If  
you're performing an integration test, it could be that you aren't giving  
ES time to completely initialize and bind to the port and be ready to  
accept connections. Or that you aren't configuring your local node to be a  
server so it's not binding to the port to which you wish to connect.

I don't know the deterministic way to wait for ES to be listening to its  
ports, so one of my production servers (that uses a TransportClient and  
contains our business logic) waits 4 seconds for ES to start up, and then  
waits for the Yellow status (at least) before it starts. That has never  
failed to start-up properly, probably due to the TransportClient retrying  
the initial connection if it's not yet available during the wait for yellow  
status. Perhaps?

Your colleague's case is successful when connecting to another host because  
more than likely ES is already up and running on that other host.

Brian

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ec9ac253-236e-4ad2-b37b-d63e5030e018%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ec9ac253-236e-4ad2-b37b-d63e5030e018%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 2, 2014, 2:06pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/3 "2014-04-02T14:06:04Z")

</div>

You are starting local node, which is using local transport, which is not  
listening on port 9300. The log message that you see is from transport  
client that tries to connect to port 9300 but cannot. Try starting just  
your node and you will be see that nobody listens on port 9300.

On Tuesday, April 1, 2014 12:52:41 PM UTC-4, Dario Rossi wrote:

> I've the following problem: to do an integration test, I set up an  
> embedded node and then I create a TransportClient to connect to it.
> 
> The setup of the embedded node is (among other things):
> 
> port = 11547; // User ports range 1024 - 49151  
> tcpport = 9300;  
> settings.put("http.port", port);  
> settings.put("transport.tcp.port", tcpport);
> 
> ```
> Settings esSettings = settings.build();
> 
> node = NodeBuilder.nodeBuilder().local(true).settings(esSettings).
> 
> ```
> 
> node(); //I tried setting local to false too  
> node.start();
> 
> and the transportclient is as simple as:
> 
> TransportClient client = new TransportClient();  
> client.addTransportAddress(new InetSocketTransportAddress(  
> "localhost", 9300));
> 
> ```
> client.prepareIndex("test", "type").setSource("field", "value").
> 
> ```
> 
> execute().actionGet();
> 
> (I tried both localhost and 127.0.0.1).
> 
> Anyway I get a connection refused when running the above code:
> 
> Caused by: java.net.ConnectException: Connection refused: localhost/127.0.  
> 0.1:9300  
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> connect(NioClientBoss.java:150)  
> at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> processSelectedKeys(NioClientBoss.java:105)  
> at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> process(NioClientBoss.java:79)  
> at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.  
> run(AbstractNioSelector.java:318)  
> at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(  
> NioClientBoss.java:42)  
> at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(  
> ThreadRenamingRunnable.java:108)  
> at org.elasticsearch.common.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)  
> [2014-04-01 17:48:10,836][TRACE][org.elasticsearch.transport.netty] [Cap 'N  
> Hawk] connect exception caught on transport layer [[id: 0x9526b405]]  
> java.net.ConnectException: Connection refused: localhost/127.0.0.1:9300  
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)  
> at  
> org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> at  
> org.elasticsearch.common.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)
> 
> my colleague was successful when he tried to connect to another host. but  
> he fails with localhost.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d573c5ca-ada7-48b9-acb5-12cbd925bdee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d573c5ca-ada7-48b9-acb5-12cbd925bdee%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 2, 2014, 2:09pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/4 "2014-04-02T14:09:16Z")

</div>

So shall I set local to false?

Il giorno mercoledì 2 aprile 2014 15:06:04 UTC+1, Igor Motov ha scritto:

> You are starting local node, which is using local transport, which is not  
> listening on port 9300. The log message that you see is from transport  
> client that tries to connect to port 9300 but cannot. Try starting just  
> your node and you will be see that nobody listens on port 9300.
> 
> On Tuesday, April 1, 2014 12:52:41 PM UTC-4, Dario Rossi wrote:
> 
> > I've the following problem: to do an integration test, I set up an  
> > embedded node and then I create a TransportClient to connect to it.
> > 
> > The setup of the embedded node is (among other things):
> > 
> > port = 11547; // User ports range 1024 - 49151  
> > tcpport = 9300;  
> > settings.put("http.port", port);  
> > settings.put("transport.tcp.port", tcpport);
> > 
> > ```
> > Settings esSettings = settings.build();
> > 
> > node = NodeBuilder.nodeBuilder().local(true).settings(esSettings
> > 
> > ```
> > 
> > ).node(); //I tried setting local to false too  
> > node.start();
> > 
> > and the transportclient is as simple as:
> > 
> > TransportClient client = new TransportClient();  
> > client.addTransportAddress(new InetSocketTransportAddress(  
> > "localhost", 9300));
> > 
> > ```
> > client.prepareIndex("test", "type").setSource("field", "value").
> > 
> > ```
> > 
> > execute().actionGet();
> > 
> > (I tried both localhost and 127.0.0.1).
> > 
> > Anyway I get a connection refused when running the above code:
> > 
> > Caused by: java.net.ConnectException: Connection refused: localhost/127.0  
> > .0.1:9300  
> > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708  
> > )  
> > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > connect(NioClientBoss.java:150)  
> > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > processSelectedKeys(NioClientBoss.java:105)  
> > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > process(NioClientBoss.java:79)  
> > at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector  
> > .run(AbstractNioSelector.java:318)  
> > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(  
> > NioClientBoss.java:42)  
> > at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(  
> > ThreadRenamingRunnable.java:108)  
> > at org.elasticsearch.common.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)  
> > [2014-04-01 17:48:10,836][TRACE][org.elasticsearch.transport.netty] [Cap 'N  
> > Hawk] connect exception caught on transport layer [[id: 0x9526b405]]  
> > java.net.ConnectException: Connection refused: localhost/127.0.0.1:9300  
> > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> > at  
> > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
> > at  
> > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)  
> > at  
> > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)  
> > at  
> > org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> > at  
> > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)  
> > at  
> > org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> > at  
> > org.elasticsearch.common.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)
> > 
> > my colleague was successful when he tried to connect to another host. but  
> > he fails with localhost.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c7a89428-58e3-45b6-a8a4-2b4a651351aa%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c7a89428-58e3-45b6-a8a4-2b4a651351aa%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 2, 2014, 2:16pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/5 "2014-04-02T14:16:29Z")

</div>

If you want to be able to connect to it using Transport Client - yes or  
remove it completely. If you still get some failure - post here complete  
log.

On Wednesday, April 2, 2014 10:09:16 AM UTC-4, Dario Rossi wrote:

> So shall I set local to false?
> 
> Il giorno mercoledì 2 aprile 2014 15:06:04 UTC+1, Igor Motov ha scritto:
> 
> > You are starting local node, which is using local transport, which is not  
> > listening on port 9300. The log message that you see is from transport  
> > client that tries to connect to port 9300 but cannot. Try starting just  
> > your node and you will be see that nobody listens on port 9300.
> > 
> > On Tuesday, April 1, 2014 12:52:41 PM UTC-4, Dario Rossi wrote:
> > 
> > > I've the following problem: to do an integration test, I set up an  
> > > embedded node and then I create a TransportClient to connect to it.
> > > 
> > > The setup of the embedded node is (among other things):
> > > 
> > > port = 11547; // User ports range 1024 - 49151  
> > > tcpport = 9300;  
> > > settings.put("http.port", port);  
> > > settings.put("transport.tcp.port", tcpport);
> > > 
> > > ```
> > > Settings esSettings = settings.build();
> > > 
> > > node = NodeBuilder.nodeBuilder().local(true).settings(esSettings
> > > 
> > > ```
> > > 
> > > ).node(); //I tried setting local to false too  
> > > node.start();
> > > 
> > > and the transportclient is as simple as:
> > > 
> > > TransportClient client = new TransportClient();  
> > > client.addTransportAddress(new InetSocketTransportAddress(  
> > > "localhost", 9300));
> > > 
> > > ```
> > > client.prepareIndex("test", "type").setSource("field", "value").
> > > 
> > > ```
> > > 
> > > execute().actionGet();
> > > 
> > > (I tried both localhost and 127.0.0.1).
> > > 
> > > Anyway I get a connection refused when running the above code:
> > > 
> > > Caused by: java.net.ConnectException: Connection refused: localhost/  
> > > 127.0.0.1:9300  
> > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:  
> > > 708)  
> > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > > connect(NioClientBoss.java:150)  
> > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > > processSelectedKeys(NioClientBoss.java:105)  
> > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > > process(NioClientBoss.java:79)  
> > > at org.elasticsearch.common.netty.channel.socket.nio.  
> > > AbstractNioSelector.run(AbstractNioSelector.java:318)  
> > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(  
> > > NioClientBoss.java:42)  
> > > at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(  
> > > ThreadRenamingRunnable.java:108)  
> > > at org.elasticsearch.common.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)  
> > > [2014-04-01 17:48:10,836][TRACE][org.elasticsearch.transport.netty] [Cap 'N  
> > > Hawk] connect exception caught on transport layer [[id: 0x9526b405]]  
> > > java.net.ConnectException: Connection refused: localhost/127.0.0.1:9300  
> > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > at  
> > > sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> > > at  
> > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
> > > at  
> > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)  
> > > at  
> > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)  
> > > at  
> > > org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> > > at  
> > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)  
> > > at  
> > > org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> > > at  
> > > org.elasticsearch.common.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)
> > > 
> > > my colleague was successful when he tried to connect to another host.  
> > > but he fails with localhost.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4a1a6942-8b26-4376-81cc-bd75d5f3c863%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4a1a6942-8b26-4376-81cc-bd75d5f3c863%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 2, 2014, 2:24pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/6 "2014-04-02T14:24:35Z")

</div>

I set it to local = false and now I don't get anymore the connection  
refused. But unfortunaly I get another thing:

[2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.transport.netty] [Humus  
Sapien] using worker\_count[12], port[9300-9400], bind\_host[null],publish\_host  
[null], compress[false], connect\_timeout[30s], connections\_per\_node[2/3/6/1/  
1], receive\_predictor[512kb-\>512kb]  
[2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.client.transport] [Humus  
Sapien] node\_sampler\_interval[5s]  
[2014-04-02 15:19:23,232][DEBUG][org.elasticsearch.client.transport] [Humus  
Sapien] adding address [[#transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
[2014-04-02 15:19:23,232][TRACE][org.elasticsearch.client.transport] [Humus  
Sapien] connecting to listed node (light) [[  
#transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
[2014-04-02 15:19:23,233][TRACE][org.elasticsearch.transport.netty] [Jean  
Grey-Summers] channel opened: [id: 0x6045a678, /127.0.0.1:51541 =\> /127.0.  
0.1:9300]  
[2014-04-02 15:19:23,233][DEBUG][org.elasticsearch.transport.netty] [Humus  
Sapien] connected to node [[  
#transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
[2014-04-02 15:19:23,250][TRACE][org.elasticsearch.plugins] [Jean Grey-  
Summers] starting to fetch info on plugins  
[2014-04-02 15:19:23,262][WARN][org.elasticsearch.client.transport] [Humus  
Sapien] node [#transport#-1][d][inet[localhost/127.0.0.1:9300]] not part of  
the cluster Cluster [elasticsearch], ignoring...

org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at org.elasticsearch.client.transport.TransportClientNodesService.execute(  
TransportClientNodesService.java:219)  
at org.elasticsearch.client.transport.support.InternalTransportClient.  
execute(InternalTransportClient.java:106)  
at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.  
java:82)  
at org.elasticsearch.client.transport.TransportClient.index(TransportClient  
.java:330)  
at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(  
IndexRequestBuilder.java:314)  
at org.elasticsearch.action.ActionRequestBuilder.execute(  
ActionRequestBuilder.java:85)  
at org.elasticsearch.action.ActionRequestBuilder.execute(  
ActionRequestBuilder.java:59)  
at com.mycode.estests.test.TransportTest.transportTest(TransportTest.java:  
20)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.  
java:57)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(  
DelegatingMethodAccessorImpl.java:43)  
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(  
FrameworkMethod.java:47)  
at org.junit.internal.runners.model.ReflectiveCallable.run(  
ReflectiveCallable.java:12)  
at org.junit.runners.model.FrameworkMethod.invokeExplosively(  
FrameworkMethod.java:44)  
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod  
.java:17)  
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner  
.java:70)  
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner  
.java:50)  
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)  
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)  
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)  
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)  
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)  
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.  
java:26)  
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:  
27)  
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)  
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)  
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(  
JUnit4IdeaTestRunner.java:74)  
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(  
JUnitStarter.java:202)  
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.  
java:57)  
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Il giorno mercoledì 2 aprile 2014 15:16:29 UTC+1, Igor Motov ha scritto:

> If you want to be able to connect to it using Transport Client - yes or  
> remove it completely. If you still get some failure - post here complete  
> log.
> 
> On Wednesday, April 2, 2014 10:09:16 AM UTC-4, Dario Rossi wrote:
> 
> > So shall I set local to false?
> > 
> > Il giorno mercoledì 2 aprile 2014 15:06:04 UTC+1, Igor Motov ha scritto:
> > 
> > > You are starting local node, which is using local transport, which is  
> > > not listening on port 9300. The log message that you see is from transport  
> > > client that tries to connect to port 9300 but cannot. Try starting just  
> > > your node and you will be see that nobody listens on port 9300.
> > > 
> > > On Tuesday, April 1, 2014 12:52:41 PM UTC-4, Dario Rossi wrote:
> > > 
> > > > I've the following problem: to do an integration test, I set up an  
> > > > embedded node and then I create a TransportClient to connect to it.
> > > > 
> > > > The setup of the embedded node is (among other things):
> > > > 
> > > > port = 11547; // User ports range 1024 - 49151  
> > > > tcpport = 9300;  
> > > > settings.put("http.port", port);  
> > > > settings.put("transport.tcp.port", tcpport);
> > > > 
> > > > ```
> > > > Settings esSettings = settings.build();
> > > > 
> > > > node = NodeBuilder.nodeBuilder().local(true).settings(
> > > > 
> > > > ```
> > > > 
> > > > esSettings).node(); //I tried setting local to false too  
> > > > node.start();
> > > > 
> > > > and the transportclient is as simple as:
> > > > 
> > > > TransportClient client = new TransportClient();  
> > > > client.addTransportAddress(new InetSocketTransportAddress(  
> > > > "localhost", 9300));
> > > > 
> > > > ```
> > > > client.prepareIndex("test", "type").setSource("field", "value"
> > > > 
> > > > ```
> > > > 
> > > > ).execute().actionGet();
> > > > 
> > > > (I tried both localhost and 127.0.0.1).
> > > > 
> > > > Anyway I get a connection refused when running the above code:
> > > > 
> > > > Caused by: java.net.ConnectException: Connection refused: localhost/  
> > > > 127.0.0.1:9300  
> > > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:  
> > > > 708)  
> > > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > > > connect(NioClientBoss.java:150)  
> > > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > > > processSelectedKeys(NioClientBoss.java:105)  
> > > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.  
> > > > process(NioClientBoss.java:79)  
> > > > at org.elasticsearch.common.netty.channel.socket.nio.  
> > > > AbstractNioSelector.run(AbstractNioSelector.java:318)  
> > > > at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run  
> > > > (NioClientBoss.java:42)  
> > > > at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(  
> > > > ThreadRenamingRunnable.java:108)  
> > > > at org.elasticsearch.common.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)  
> > > > [2014-04-01 17:48:10,836][TRACE][org.elasticsearch.transport.netty] [  
> > > > Cap 'N Hawk] connect exception caught on transport layer [[id:  
> > > > 0x9526b405]]  
> > > > java.net.ConnectException: Connection refused: localhost/127.0.0.1:9300  
> > > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > > at  
> > > > sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)  
> > > > at  
> > > > org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> > > > at  
> > > > org.elasticsearch.common.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)
> > > > 
> > > > my colleague was successful when he tried to connect to another host.  
> > > > but he fails with localhost.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c38cca3b-7643-4c02-8946-9d7e251567b5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c38cca3b-7643-4c02-8946-9d7e251567b5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 2, 2014, 2:27pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/7 "2014-04-02T14:27:19Z")

</div>

I forgot, after setting up the embedded node, I wait the cluster status to  
be Yellow with

Client client = node.client();  
client.admin().cluster().prepareHealth().setWaitForYellowStatus().  
execute().actionGet();

this is done on the embedded node.

Il giorno mercoledì 2 aprile 2014 15:24:35 UTC+1, Dario Rossi ha scritto:

> I set it to local = false and now I don't get anymore the connection  
> refused. But unfortunaly I get another thing:
> 
> [2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.transport.netty] [Humus  
> Sapien] using worker\_count[12], port[9300-9400], bind\_host[null],publish\_host  
> [null], compress[false], connect\_timeout[30s], connections\_per\_node[2/3/6/  
> 1/1], receive\_predictor[512kb-\>512kb]  
> [2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.client.transport] [  
> Humus Sapien] node\_sampler\_interval[5s]  
> [2014-04-02 15:19:23,232][DEBUG][org.elasticsearch.client.transport] [  
> Humus Sapien] adding address [[  
> #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> [2014-04-02 15:19:23,232][TRACE][org.elasticsearch.client.transport] [  
> Humus Sapien] connecting to listed node (light) [[  
> #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> [2014-04-02 15:19:23,233][TRACE][org.elasticsearch.transport.netty] [Jean  
> Grey-Summers] channel opened: [id: 0x6045a678, /127.0.0.1:51541 =\> /127.0.  
> 0.1:9300]  
> [2014-04-02 15:19:23,233][DEBUG][org.elasticsearch.transport.netty] [Humus  
> Sapien] connected to node [[  
> #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> [2014-04-02 15:19:23,250][TRACE][org.elasticsearch.plugins] [Jean Grey-  
> Summers] starting to fetch info on plugins  
> [2014-04-02 15:19:23,262][WARN][org.elasticsearch.client.transport] [  
> Humus Sapien] node [#transport#-1][d][inet[localhost/127.0.0.1:9300]] not  
> part of the cluster Cluster [elasticsearch], ignoring...
> 
> org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> available  
> at org.elasticsearch.client.transport.TransportClientNodesService.execute  
> (TransportClientNodesService.java:219)  
> at org.elasticsearch.client.transport.support.InternalTransportClient.  
> execute(InternalTransportClient.java:106)  
> at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.  
> java:82)  
> at org.elasticsearch.client.transport.TransportClient.index(  
> TransportClient.java:330)  
> at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(  
> IndexRequestBuilder.java:314)  
> at org.elasticsearch.action.ActionRequestBuilder.execute(  
> ActionRequestBuilder.java:85)  
> at org.elasticsearch.action.ActionRequestBuilder.execute(  
> ActionRequestBuilder.java:59)  
> at com.mycode.estests.test.TransportTest.transportTest(TransportTest.java  
> :20)  
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.  
> java:57)  
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(  
> DelegatingMethodAccessorImpl.java:43)  
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(  
> FrameworkMethod.java:47)  
> at org.junit.internal.runners.model.ReflectiveCallable.run(  
> ReflectiveCallable.java:12)  
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(  
> FrameworkMethod.java:44)  
> at org.junit.internal.runners.statements.InvokeMethod.\<span  
> style="color: #000;" class  
> ...

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/abfaf316-eb85-4b77-a656-a119faeb326e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/abfaf316-eb85-4b77-a656-a119faeb326e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 2, 2014, 2:31pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/8 "2014-04-02T14:31:06Z")

</div>

You should specify the same cluster name for both node and transport  
client. It looks like they are running in different clusters:

[2014-04-02 15:19:23,262][WARN][org.elasticsearch.client.transport] [Humus  
Sapien] node [#transport#-1][d][inet[localhost/127.0.0.1:9300]] not part of  
the cluster Cluster [elasticsearch], ignoring...

On Wednesday, April 2, 2014 10:27:19 AM UTC-4, Dario Rossi wrote:

> I forgot, after setting up the embedded node, I wait the cluster status to  
> be Yellow with
> 
> Client client = node.client();  
> client.admin().cluster().prepareHealth().setWaitForYellowStatus().  
> execute().actionGet();
> 
> this is done on the embedded node.
> 
> Il giorno mercoledì 2 aprile 2014 15:24:35 UTC+1, Dario Rossi ha scritto:
> 
> > I set it to local = false and now I don't get anymore the connection  
> > refused. But unfortunaly I get another thing:
> > 
> > [2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.transport.netty] [  
> > Humus Sapien] using worker\_count[12], port[9300-9400], bind\_host[null],publish\_host  
> > [null], compress[false], connect\_timeout[30s], connections\_per\_node[2/3/6  
> > /1/1], receive\_predictor[512kb-\>512kb]  
> > [2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.client.transport] [  
> > Humus Sapien] node\_sampler\_interval[5s]  
> > [2014-04-02 15:19:23,232][DEBUG][org.elasticsearch.client.transport] [  
> > Humus Sapien] adding address [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> > [2014-04-02 15:19:23,232][TRACE][org.elasticsearch.client.transport] [  
> > Humus Sapien] connecting to listed node (light) [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> > [2014-04-02 15:19:23,233][TRACE][org.elasticsearch.transport.netty] [Jean  
> > Grey-Summers] channel opened: [id: 0x6045a678, /127.0.0.1:51541 =\> /127.0  
> > .0.1:9300]  
> > [2014-04-02 15:19:23,233][DEBUG][org.elasticsearch.transport.netty] [  
> > Humus Sapien] connected to node [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> > [2014-04-02 15:19:23,250][TRACE][org.elasticsearch.plugins] [Jean Grey-  
> > Summers] starting to fetch info on plugins  
> > [2014-04-02 15:19:23,262][WARN][org.elasticsearch.client.transport] [  
> > Humus Sapien] node [#transport#-1][d][inet[localhost/127.0.0.1:9300]]  
> > not part of the cluster Cluster [elasticsearch], ignoring...
> > 
> > org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> > available  
> > at org.elasticsearch.client.transport.TransportClientNodesService.  
> > execute(TransportClientNodesService.java:219)  
> > at org.elasticsearch.client.transport.support.InternalTransportClient.  
> > execute(InternalTransportClient.java:106)  
> > at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.  
> > java:82)  
> > at org.elasticsearch.client.transport.TransportClient.index(  
> > TransportClient.java:330)  
> > at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(  
> > IndexRequestBuilder.java:314)  
> > at org.elasticsearch.action.ActionRequestBuilder.execute(  
> > ActionRequestBuilder.java:85)  
> > at org.elasticsearch.action.ActionRequestBuilder.execute(  
> > ActionRequestBuilder.java:59)  
> > at com.mycode.estests.test.TransportTest.transportTest(TransportTest.  
> > java:20)  
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.  
> > java:57)  
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(  
> > DelegatingMethodAccessorImpl.java:43)  
> > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(  
> > FrameworkMethod.java:47)  
> > at org.junit.internal.runners.model.ReflectiveCallable.run(  
> > ReflectiveCallable.java:12)  
> > at org.junit.runners.model.FrameworkMethod.invokeExplosively(  
> > FrameworkMethod.java:44)  
> > at org.junit.internal.runners.statements.InvokeMethod.\<span  
> > style="color: #000;" class  
> > ...

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7da21dd1-e3cd-4e3e-8636-1eabb736593d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7da21dd1-e3cd-4e3e-8636-1eabb736593d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 2, 2014, 2:39pm UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/9 "2014-04-02T14:39:15Z")

</div>

Thanks, it works now.

I suggest to point out the detail about local transport in the docs for  
TransportClient.

Il giorno mercoledì 2 aprile 2014 15:31:06 UTC+1, Igor Motov ha scritto:

> You should specify the same cluster name for both node and transport  
> client. It looks like they are running in different clusters:
> 
> [2014-04-02 15:19:23,262][WARN][org.elasticsearch.client.transport] [  
> Humus Sapien] node [#transport#-1][d][inet[localhost/127.0.0.1:9300]] not  
> part of the cluster Cluster [elasticsearch], ignoring...
> 
> On Wednesday, April 2, 2014 10:27:19 AM UTC-4, Dario Rossi wrote:
> 
> > I forgot, after setting up the embedded node, I wait the cluster status  
> > to be Yellow with
> > 
> > Client client = node.client();  
> > client.admin().cluster().prepareHealth().setWaitForYellowStatus  
> > ().execute().actionGet();
> > 
> > this is done on the embedded node.
> > 
> > Il giorno mercoledì 2 aprile 2014 15:24:35 UTC+1, Dario Rossi ha scritto:
> > 
> > > I set it to local = false and now I don't get anymore the connection  
> > > refused. But unfortunaly I get another thing:
> > > 
> > > [2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.transport.netty] [  
> > > Humus Sapien] using worker\_count[12], port[9300-9400], bind\_host[null],publish\_host  
> > > [null], compress[false], connect\_timeout[30s], connections\_per\_node[2/3/  
> > > 6/1/1], receive\_predictor[512kb-\>512kb]  
> > > [2014-04-02 15:19:23,218][DEBUG][org.elasticsearch.client.transport] [  
> > > Humus Sapien] node\_sampler\_interval[5s]  
> > > [2014-04-02 15:19:23,232][DEBUG][org.elasticsearch.client.transport] [  
> > > Humus Sapien] adding address [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> > > [2014-04-02 15:19:23,232][TRACE][org.elasticsearch.client.transport] [  
> > > Humus Sapien] connecting to listed node (light) [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> > > [2014-04-02 15:19:23,233][TRACE][org.elasticsearch.transport.netty] [  
> > > Jean Grey-Summers] channel opened: [id: 0x6045a678, /127.0.0.1:51541 =\>  
> > > /127.0.0.1:9300]  
> > > [2014-04-02 15:19:23,233][DEBUG][org.elasticsearch.transport.netty] [  
> > > Humus Sapien] connected to node [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:9300]]]  
> > > [2014-04-02 15:19:23,250][TRACE][org.elasticsearch.plugins] [Jean Grey-  
> > > Summers] starting to fetch info on plugins  
> > > [2014-04-02 15:19:23,262][WARN][org.elasticsearch.client.transport] [  
> > > Humus Sapien] node [#transport#-1][d][inet[localhost/127.0.0.1:9300]]  
> > > not part of the cluster Cluster [elasticsearch], ignoring...
> > > 
> > > org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> > > available  
> > > at org.elasticsearch.client.transport.TransportClientNodesService.  
> > > execute(TransportClientNodesService.java:219)  
> > > at org.elasticsearch.client.transport.support.InternalTransportClient.  
> > > execute(InternalTransportClient.java:106)  
> > > at org.elasticsearch.client.support.AbstractClient.index(AbstractClient  
> > > .java:82)  
> > > at org.elasticsearch.client.transport.TransportClient.index(  
> > > TransportClient.java:330)  
> > > at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(  
> > > IndexRequestBuilder.java:314)  
> > > at org.elasticsearch.action.ActionRequestBuilder.execute(  
> > > ActionRequestBuilder.java:85)  
> > > at org.elasticsearch.action.ActionRequestBuilder.execute(  
> > > ActionRequestBuilder.java:59)  
> > > at com.mycode.estests.test.TransportTest.transportTest(TransportTest.  
> > > java:20)  
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl  
> > > .java:57)  
> > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(  
> > > DelegatingMethodAccessorImpl.java:43)  
> > > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(  
> > > FrameworkMethod.java:47)  
> > > at org.junit.internal.runners.model.ReflectiveCallable.run(  
> > > ReflectiveCallable.java:12)  
> > > at org.junit.runners.model.FrameworkMethod.invokeExplosively(  
> > > FrameworkMethod.java:44)  
> > > at org.junit.internal.runners.statements.InvokeMethod.\<span  
> > > style="color: #000;" class  
> > > ...

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b05929e1-9aa8-4034-a9e3-91b75c3937a0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b05929e1-9aa8-4034-a9e3-91b75c3937a0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:38am UTC](https://discuss.elastic.co/t/transport-tcp-port-doesnt-work-for-localhost/16743/10 "2017-07-06T01:38:44Z")

</div>


