# How to specify where to find elasticsearch.yml for TransportClient?

**URL:** <https://discuss.elastic.co/t/how-to-specify-where-to-find-elasticsearch-yml-for-transportclient/2245>\
**Category:** Elasticsearch\
**Created:** [June 9, 2015, 5:52pm UTC](https://discuss.elastic.co/t/how-to-specify-where-to-find-elasticsearch-yml-for-transportclient/2245 "2015-06-09T17:52:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbessie](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@tbessie](https://discuss.elastic.co/u/tbessie)\
**Post date:** [June 9, 2015, 5:52pm UTC](https://discuss.elastic.co/t/how-to-specify-where-to-find-elasticsearch-yml-for-transportclient/2245/1 "2015-06-09T17:52:03Z")

</div>

I want to specify where TransportClient can find elasticsearch.yml - from what I can see, the documentation on Java clients doesn't talk much about it, except to say:

> You can define cluster.name in the /src/main/resources/elasticsearch.yml file in your project. As long as elasticsearch.yml is present in the classpath, it will be used when you start your node.

I'm not building with Maven, just using eclipse and we don't use the above source hierarchy style. A forum discussion says one can put elasticsearch.yml "in /" but that's as much as I've found.

Is there a complete discussion of where I can put elasticsearch.yml for client-side code to find it? Can I specify it programmatically? What are the options? Links to documentation on that subject?

- Tim

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [June 11, 2015, 1:50pm UTC](https://discuss.elastic.co/t/how-to-specify-where-to-find-elasticsearch-yml-for-transportclient/2245/2 "2015-06-11T13:50:00Z")

</div>

hey tim,

will this help ? [https://github.com/elastic/elasticsearch/blob/master/core/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java#L38](https://github.com/elastic/elasticsearch/blob/master/core/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java#L38)

---

<div class="post-metadata">

**Author:** ![tbessie](https://avatars.discourse-cdn.com/v4/letter/t/a698b9/32.png) [@tbessie](https://discuss.elastic.co/u/tbessie)\
**Post date:** [June 11, 2015, 6:06pm UTC](https://discuss.elastic.co/t/how-to-specify-where-to-find-elasticsearch-yml-for-transportclient/2245/3 "2015-06-11T18:06:20Z")

</div>

That's helpful, yes, thanks!

I also realized that I was already setting the client's location for elasticsearch.yml through setting it as a system property, thus:

> System.setProperty("es.config", "[path-to-elasticsearch.ytml]");

So... d'oh! 😄

- Tim

---

<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, 12:08am UTC](https://discuss.elastic.co/t/how-to-specify-where-to-find-elasticsearch-yml-for-transportclient/2245/4 "2017-07-06T00:08:04Z")

</div>


