Java client handling connection failure


(Mohit Anchlia) #1

I am currently creating a client connection as shown below. One of the
questions I have is what is the right way to provide high availability and
reseliency on the client side when the node that I am connecting to fails?
Does this client automatically discovers all the nodes in the cluster and
retry on other nodes?

Client client = new TransportClient()

.addTransportAddress(new InetSocketTransportAddress("host1", 9300))

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(vineeth mohan-2) #2

Hello Mohit ,

I am no expert in this , but i feel adding the sniff might help -

Settings settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", clusterName)

  • .put("client.transport.sniff", true)*
    .build();
    TransportClient client = new TransportClient(settings);
    client.addTransportAddresses(new InetSocketTransportAddress(esHost,
    esPort));

Thanks
Vineeth

On Sat, Apr 12, 2014 at 12:43 AM, Mohit Anchlia mohitanchlia@gmail.comwrote:

I am currently creating a client connection as shown below. One of the
questions I have is what is the right way to provide high availability and
reseliency on the client side when the node that I am connecting to fails?
Does this client automatically discovers all the nodes in the cluster and
retry on other nodes?

Client client = new TransportClient()

.addTransportAddress(new InetSocketTransportAddress("host1", 9300))

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nm1s38eqazRbLHBfwO3xZaLt9SmRWLKkGRCvBV3MPqig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Mohit Anchlia) #3

Yeah I looked at it but it only says that it's used as round robin. It
doesn't talk about reseliency during connection faiiures

On Sat, Apr 12, 2014 at 5:52 AM, vineeth mohan vm.vineethmohan@gmail.comwrote:

Hello Mohit ,

I am no expert in this , but i feel adding the sniff might help -

Settings settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", clusterName)

  • .put("client.transport.sniff", true)*
    .build();
    TransportClient client = new TransportClient(settings);
    client.addTransportAddresses(new InetSocketTransportAddress(esHost,
    esPort));

Thanks
Vineeth

On Sat, Apr 12, 2014 at 12:43 AM, Mohit Anchlia mohitanchlia@gmail.comwrote:

I am currently creating a client connection as shown below. One of the
questions I have is what is the right way to provide high availability and
reseliency on the client side when the node that I am connecting to fails?
Does this client automatically discovers all the nodes in the cluster and
retry on other nodes?

Client client = new TransportClient()

.addTransportAddress(new InetSocketTransportAddress("host1", 9300))

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nm1s38eqazRbLHBfwO3xZaLt9SmRWLKkGRCvBV3MPqig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGdPd5nm1s38eqazRbLHBfwO3xZaLt9SmRWLKkGRCvBV3MPqig%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAOT3TWpnvO_npcnb%2B3H2FY46wamc7iYOf2DkTq7sy4yTNBkDwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #4

The TransportClient uses a heartbeat signal every 5 secs to discover if the
node can still respond. If not, it will be dropped. "Sniffing" means, the
TransportClient can automatically connect to newly discovered nodes (e.g.
if the node comes up again, the client reconnects). The TransportClient
must be connected to at least one node all the time.

Jörg

On Sat, Apr 12, 2014 at 6:24 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

Yeah I looked at it but it only says that it's used as round robin. It
doesn't talk about reseliency during connection faiiures

On Sat, Apr 12, 2014 at 5:52 AM, vineeth mohan vm.vineethmohan@gmail.comwrote:

Hello Mohit ,

I am no expert in this , but i feel adding the sniff might help -

Settings settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", clusterName)

  • .put("client.transport.sniff", true)*
    .build();
    TransportClient client = new TransportClient(settings);
    client.addTransportAddresses(new InetSocketTransportAddress(esHost,
    esPort));

Thanks
Vineeth

On Sat, Apr 12, 2014 at 12:43 AM, Mohit Anchlia mohitanchlia@gmail.comwrote:

I am currently creating a client connection as shown below. One of the
questions I have is what is the right way to provide high availability and
reseliency on the client side when the node that I am connecting to fails?
Does this client automatically discovers all the nodes in the cluster and
retry on other nodes?

Client client = new TransportClient()

.addTransportAddress(new InetSocketTransportAddress("host1", 9300))

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWoNGePYwohTZwSc1EBgjkUZ3zvd4NLcLdiYUX8eUUnj1g%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nm1s38eqazRbLHBfwO3xZaLt9SmRWLKkGRCvBV3MPqig%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAGdPd5nm1s38eqazRbLHBfwO3xZaLt9SmRWLKkGRCvBV3MPqig%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAOT3TWpnvO_npcnb%2B3H2FY46wamc7iYOf2DkTq7sy4yTNBkDwg%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CAOT3TWpnvO_npcnb%2B3H2FY46wamc7iYOf2DkTq7sy4yTNBkDwg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFJ02KNZWuzAqck%2B5zgc6JeE6EVvRCTtDBhguQAV%2B%3D7zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #5