# Question About Settings/Config

**URL:** <https://discuss.elastic.co/t/question-about-settings-config/5898>\
**Category:** Elasticsearch\
**Created:** [November 17, 2011, 1:18pm UTC](https://discuss.elastic.co/t/question-about-settings-config/5898 "2011-11-17T13:18:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LORDs\_diakonos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lords_diakonos/32/3009_2.png) [@LORDs\_diakonos](https://discuss.elastic.co/u/LORDs_diakonos)\
**Post date:** [November 17, 2011, 1:18pm UTC](https://discuss.elastic.co/t/question-about-settings-config/5898/1 "2011-11-17T13:18:53Z")

</div>

OK from reading here  
[https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java](https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java)

It would seem that I can hardcode properties in Java then have them  
overridden by the yml file on the classpath. I have seen this work.  
What about the Java System Properties. I see I can prefix them with  
an es.

Do these supersede even the YML? What is the expected order/hierarchy here?

Also below is how I am initing all this. Does this look correct for  
what I am after? Thoughts? Improvements?  
\_nodeInstance = nodeBuilder().  
settings(ImmutableSettings.settingsBuilder().  
put("number\_of\_shards", 5).  
put("number\_of\_replicas", 1).  
put("gateway.type", "local").  
put("cluster.name", "dotCMSContentStore").  
put("path.data", "dotCMS/dotsecure/esdata").  
put("name", node\_id).  
build()).  
build().  
start();

Thanks,  
Jason Tesser  
dotCMS Director, Support Services  
1-305-858-1422

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 20, 2011, 7:56am UTC](https://discuss.elastic.co/t/question-about-settings-config/5898/2 "2011-11-20T07:56:22Z")

</div>

Yes, system properties will be preferred over the explicit ones set in the  
"yml" configuration. You can control what gets loaded when and how by  
constructing your own settings object, and passing it to the NodeBuilder.

On Thu, Nov 17, 2011 at 3:18 PM, Jason Tesser [jasontesser@gmail.com](mailto:jasontesser@gmail.com) wrote:

> OK from reading here
> 
> [https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java](https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/node/NodeBuilder.java)
> 
> It would seem that I can hardcode properties in Java then have them  
> overridden by the yml file on the classpath. I have seen this work.  
> What about the Java System Properties. I see I can prefix them with  
> an es.
> 
> Do these supersede even the YML? What is the expected order/hierarchy  
> here?
> 
> Also below is how I am initing all this. Does this look correct for  
> what I am after? Thoughts? Improvements?  
> \_nodeInstance = nodeBuilder().  
> settings(ImmutableSettings.settingsBuilder().  
> put("number\_of\_shards", 5).  
> put("number\_of\_replicas", 1).  
> put("gateway.type", "local").  
> put("cluster.name", "dotCMSContentStore").  
> put("path.data", "dotCMS/dotsecure/esdata").  
> put("name", node\_id).  
> build()).  
> build().  
> start();
> 
> Thanks,  
> Jason Tesser  
> dotCMS Director, Support Services  
> 1-305-858-1422

---

<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, 3:48am UTC](https://discuss.elastic.co/t/question-about-settings-config/5898/3 "2017-07-06T03:48:11Z")

</div>


