# How to add nodes to cluster through source code

**URL:** <https://discuss.elastic.co/t/how-to-add-nodes-to-cluster-through-source-code/173716>\
**Category:** Elasticsearch\
**Created:** [March 25, 2019, 10:00am UTC](https://discuss.elastic.co/t/how-to-add-nodes-to-cluster-through-source-code/173716 "2019-03-25T10:00:23Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![MKU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mku/32/48327_2.png) [@MKU](https://discuss.elastic.co/u/MKU)\
**Post date:** [April 22, 2019, 9:40am UTC](https://discuss.elastic.co/t/how-to-add-nodes-to-cluster-through-source-code/173716/5 "2019-04-22T09:40:31Z")

</div>

[In this post](https://discuss.elastic.co/t/set-up-elasticsearch-cluster-2-nodes-on-same-machine/120824/5) , he added nodes by ,  
`node.max_local_storage_nodes: 4` in `elasticsearch.yml` .

Is it not possible to **hardcode** the number of nodes in source code.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-add-nodes-to-cluster-through-source-code/173716)._
