Simple question about node creation


(steam) #1

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Client client = node.client();

My question is: when your application will create clien node to connect and consult index to master server node,
you always must close node and client after each search query?
like:
client.close();
node.close();

Or only i must close client?

Advance thank you very much.


(David Pilato) #2

I suggest to close the client and the node only when your application stops.

HTH
David

Le 8 nov. 2011 à 14:35, steam grandebuzon@gmail.com a écrit :

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Client client = node.client();

My question is: when your application will create clien node to connect and
consult index to master server node,
you always must close node and client after each search query?
like:
client.close();
node.close();

Or only i must close client?

Advance thank you very much.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Simple-question-about-node-creation-tp3490292p3490292.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(steam) #3

I understand, thanks for reply )


(Andy-3) #4

what if my jvm crashes and I don't close the client. How do the other
nodes react. I assume (hope) everything will be ok?

thanks!

On Nov 9, 1:12 am, David Pilato da...@pilato.fr wrote:

I suggest toclosetheclientand the node only when your application stops.

HTH
David

Le 8 nov. 2011 à 14:35, steam grandebu...@gmail.com a écrit :

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Clientclient= node.client();

My question is: when your application will create clien node to connect and
consult index to master server node,
you always mustclosenode andclientafter each search query?
like:
client.close();
node.close();

Or only i mustcloseclient?

Advance thank you very much.

--
View this message in context:http://elasticsearch-users.115913.n3.nabble.com/Simple-question-about...
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(Shay Banon) #5

Yes, either the socket will be broken and immediately identified as a
failed node, or the fault detection process will identify it.

On Tue, Nov 15, 2011 at 7:54 PM, Andy apryor48@gmail.com wrote:

what if my jvm crashes and I don't close the client. How do the other
nodes react. I assume (hope) everything will be ok?

thanks!

On Nov 9, 1:12 am, David Pilato da...@pilato.fr wrote:

I suggest toclosetheclientand the node only when your application stops.

HTH
David

Le 8 nov. 2011 à 14:35, steam grandebu...@gmail.com a écrit :

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Clientclient= node.client();

My question is: when your application will create clien node to
connect and

consult index to master server node,
you always mustclosenode andclientafter each search query?
like:
client.close();
node.close();

Or only i mustcloseclient?

Advance thank you very much.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Simple-question-about...

Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #6