Java client, do I put the elasticsearch.yml in my /resources?


(gitted) #1
  1. Newbie question, but when I use an elastic search client (java client),
    do I put the elasticsearch.yml file in my /resources i.e classpath?

I ran my java app w/o the .yml file and it worked fine when I indexed to
ES, I guess by default it connects to the default ES port?

  1. What I don't understand, when creating a client, why is there even an
    option to have this client be part of the cluster? I mean you are creating
    a client using the nodeBuilder, what is the reason for this? My guess is
    the code is re-used so you don't have to repeat things internally?

Thanks.

--
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/c87213d6-02c5-4c76-b115-14a2ebeceeaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

1/ yes. If you have an elasticsearch.yml file in your classpath under /, it will be used.
Otherwise, defaults are used.

2/ A NodeClient knows where all shards live. It means that it will route directly your requests to the right nodes.

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 16 juin 2014 à 04:29, gitted sahmed1020@gmail.com a écrit :

  1. Newbie question, but when I use an elastic search client (java client), do I put the elasticsearch.yml file in my /resources i.e classpath?

I ran my java app w/o the .yml file and it worked fine when I indexed to ES, I guess by default it connects to the default ES port?

  1. What I don't understand, when creating a client, why is there even an option to have this client be part of the cluster? I mean you are creating a client using the nodeBuilder, what is the reason for this? My guess is the code is re-used so you don't have to repeat things internally?

Thanks.

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/c87213d6-02c5-4c76-b115-14a2ebeceeaf%40googlegroups.com.
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/309D98F8-3FA5-4899-9E5F-4CACE8376941%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(Ciprian-2) #3

For "2/" : let's suppose I have a cluster with next arhitecture : non-data
node, primary node and data nodes and I want to insert documents with java
api. Which is the node which should be set for transportClient in
addTransportAddress? The primary, the data or the balancing(non-data) node?
What's happen if the set node is failing? Shouln't we add another one for
managing the failling?

luni, 16 iunie 2014, 08:08:11 UTC+3, David Pilato a scris:

1/ yes. If you have an elasticsearch.yml file in your classpath under /,
it will be used.
Otherwise, defaults are used.

2/ A NodeClient knows where all shards live. It means that it will route
directly your requests to the right nodes.

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 16 juin 2014 à 04:29, gitted <sahme...@gmail.com <javascript:>> a
écrit :

  1. Newbie question, but when I use an elastic search client (java client),
    do I put the elasticsearch.yml file in my /resources i.e classpath?

I ran my java app w/o the .yml file and it worked fine when I indexed to
ES, I guess by default it connects to the default ES port?

  1. What I don't understand, when creating a client, why is there even an
    option to have this client be part of the cluster? I mean you are creating
    a client using the nodeBuilder, what is the reason for this? My guess is
    the code is re-used so you don't have to repeat things internally?

Thanks.

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/c87213d6-02c5-4c76-b115-14a2ebeceeaf%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/c87213d6-02c5-4c76-b115-14a2ebeceeaf%40googlegroups.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/4b7e8af8-565c-4c8f-8509-9edd5d39db86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #4

You should define more than one node in the transport list but you can also set client.transport.sniff to true to sniff other nodes.

If you define in your cluster a load balancing only node (no data), you probably should define it (or them) in the transport list of nodes.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 16 juin 2014 à 10:48:46, Ciprian (turcanciprian87@gmail.com) a écrit:

For "2/" : let's suppose I have a cluster with next arhitecture : non-data node, primary node and data nodes and I want to insert documents with java api. Which is the node which should be set for transportClient in addTransportAddress? The primary, the data or the balancing(non-data) node? What's happen if the set node is failing? Shouln't we add another one for managing the failling?

luni, 16 iunie 2014, 08:08:11 UTC+3, David Pilato a scris:
1/ yes. If you have an elasticsearch.yml file in your classpath under /, it will be used.
Otherwise, defaults are used.

2/ A NodeClient knows where all shards live. It means that it will route directly your requests to the right nodes.

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 16 juin 2014 à 04:29, gitted sahme...@gmail.com a écrit :

  1. Newbie question, but when I use an elastic search client (java client), do I put the elasticsearch.yml file in my /resources i.e classpath?

I ran my java app w/o the .yml file and it worked fine when I indexed to ES, I guess by default it connects to the default ES port?

  1. What I don't understand, when creating a client, why is there even an option to have this client be part of the cluster? I mean you are creating a client using the nodeBuilder, what is the reason for this? My guess is the code is re-used so you don't have to repeat things internally?

Thanks.

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c87213d6-02c5-4c76-b115-14a2ebeceeaf%40googlegroups.com.
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/4b7e8af8-565c-4c8f-8509-9edd5d39db86%40googlegroups.com.
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/etPan.539eb0cb.1f16e9e8.f9a2%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/d/optout.


(system) #5