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

Reply via email to