# I have created two instance of elasticsearch in two different machine, both instance have same cluster name but still no.of nodes is one, but i want two node

**URL:** <https://discuss.elastic.co/t/i-have-created-two-instance-of-elasticsearch-in-two-different-machine-both-instance-have-same-cluster-name-but-still-no-of-nodes-is-one-but-i-want-two-node/192231>\
**Category:** Elasticsearch\
**Created:** [July 25, 2019, 11:15am UTC](https://discuss.elastic.co/t/i-have-created-two-instance-of-elasticsearch-in-two-different-machine-both-instance-have-same-cluster-name-but-still-no-of-nodes-is-one-but-i-want-two-node/192231 "2019-07-25T11:15:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayush\_Verma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_verma/32/46709_2.png) [@Ayush\_Verma](https://discuss.elastic.co/u/Ayush_Verma)\
**Post date:** [July 25, 2019, 11:15am UTC](https://discuss.elastic.co/t/i-have-created-two-instance-of-elasticsearch-in-two-different-machine-both-instance-have-same-cluster-name-but-still-no-of-nodes-is-one-but-i-want-two-node/192231/1 "2019-07-25T11:15:57Z")

</div>

this is the output i am getting after using  
curl -X GET "localhost:9200/\_nodes"  
`{"_nodes":{"total":1,"successful":1,"failed":0},"cluster_name":"ElasticsearchStagging","nodes":{"eLSFczi5TFOotlGdB9kpsw":{"name":"node-1","transport_address":"10.128.0.23:9300","host":"10.128.0.23","ip":"10.128.0.23","version":"6.5.4","build_flavor":"default","build_type":"deb","build_hash":"d2ef93d","total_indexing_buffer":106502553,"roles":["master","data","ingest"],"attributes":{"ml.machine_memory":"3872563200","xpack.installed":"true","ml.max_open_jobs":"20","ml.enabled":"true"},"settings":{"pidfile":"/var/run/elasticsearch/elasticsearch.pid","cluster":{"name":"ElasticsearchStagging"},"node":{"attr":{"xpack":{"installed":"true"},"ml":{"machine_memory":"3872563200","max_open_jobs":"20","enabled":"true"}},"name":"node-1"},"path":{"data":["/usr/local/elasticsearch/data"],"logs":"/var/log/elasticsearch","home":"/usr/share/elasticsearch"},"client":{"type":"node"},"http":{"type":"security4","port":"9200","type.default":"netty4"},"transport":{"type":"security4","features":{"x-pack":"true"},"type.default":"netty4"},"network":{"host":"0.0.0.0"}},"os":{"refresh_interval_in_millis":1000,"name":"Linux","arch":"amd64","version":"4.15.0-1037-gcp","available_processors":1,"allocated_processors":1},"process":{"refresh_interval_in_millis":1000,"id":1781,"mlockall":false},"jvm":{"pid":1781,"version":"1.8.0_212","vm_name":"OpenJDK 64-Bit Server VM","vm_version":"25.212-b03","vm_vendor":"Oracle Corporation","start_time_in_millis":1564052291534,"mem":{"heap_init_in_bytes":1073741824,"heap_max_in_bytes":1065025536,"non_heap_init_in_bytes":2555904,"non_heap_max_in_bytes":0,"direct_max_in_bytes":1065025536},"gc_collectors":["ParNew","ConcurrentMarkSweep"],"memory_pools":["Code Cache","Metaspace","Compressed Class Space","Par Eden Space","Par Survivor Space","CMS Old Gen"],"using_compressed_ordinary_object_pointers":"true","input_arguments":["-Xms1g","-Xmx1g","-XX:+UseConcMarkSweepGC","-XX:CMSInitiatingOccupancyFraction=75","-XX:+UseCMSInitiatingOccupancyOnly","-XX:+AlwaysPreTouch","-Xss1m","-Djava.awt.headless=true","-Dfile.encoding=UTF-8","-Djna.nosys=true","-XX:-OmitStackTraceInFastThrow","-Dio.netty.noUnsafe=true","-Dio.netty.noKeySetOptimization=true","-Dio.netty.recycler.maxCapacityPerThread=0","-Dlog4j.shutdownHookEnabled=false","-Dlog4j2.disable.jmx=true","-Djava.io.tmpdir=/tmp/elasticsearch.ytvj2hNl","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=/var/lib/elasticsearch","-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log","-XX:+PrintGCDetails","-XX:+PrintGCDateStamps","-XX:+PrintTenuringDistribution","-XX:+PrintGCApplicationStoppedTime","-Xloggc:/var/log/elasticsearch/gc.log","-XX:+UseGCLogFileRotation","-XX:NumberOfGCLogFiles=32","-XX:GCLogFileSize=64m","-Des.path.home=/usr/share/elasticsearch","-Des.path.conf=/usr/local/elasticsearch/config","-Des.distribution.flavor=default","-Des.distribution.type=deb"]},"thread_pool":{"watcher":{"type":"fixed","min":5,"max":5,"queue_size":1000},"force_merge":{"type":"fixed","min":1,"max":1,"queue_size":-1},"security-token-key":{"type":"fixed","min":1,"max":1,"queue_size":1000},"ml_datafeed":{"type":"fixed","min":20,"max":20,"queue_size":200},"fetch_shard_started":{"type":"scaling","min":1,"max":2,"keep_alive":"5m","queue_size":-1},"listener":{"type":"fixed","min":1,"max":1,"queue_size":-1},"ml_autodetect":{"type":"fixed","min":80,"max":80,"queue_size":80},"index":{"type":"fixed","min":1,"max":1,"queue_size":200},"refresh":{"type":"scaling","min":1,"max":1,"keep_alive":"5m","queue_size":-1},"generic":{"type":"scaling","min":4,"max":128,"keep_alive":"30s","queue_size":-1},"rollup_indexing":{"type":"fixed","min":4,"max":4,"queue_size":4},"warmer":{"type":"scaling","min":1,"max":1,"keep_alive":"5m","queue_size":-1},"search":{"type":"fixed_auto_queue_size","min":2,"max":2,"queue_size":1000},"ccr":{"type":"fixed","min":32,"max":32,"queue_siz`

---

<div class="post-metadata">

**Author:** ![William\_Brafford](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/william_brafford/32/51559_2.png) [@William\_Brafford](https://discuss.elastic.co/u/William_Brafford)\
**Post date:** [August 2, 2019, 9:09pm UTC](https://discuss.elastic.co/t/i-have-created-two-instance-of-elasticsearch-in-two-different-machine-both-instance-have-same-cluster-name-but-still-no-of-nodes-is-one-but-i-want-two-node/192231/2 "2019-08-02T21:09:44Z")

</div>

When Elasticsearch is running on two different machines, they need a way to discover each other. The output of your curl command indicates that you're running Elasticsearch 6.5. In that version, the [setting for node discovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/discovery-settings.html) is `discovery.zen.ping.unicast.hosts`.

I would recommend adding the following setting to the `elasticsearch.yml` file on both nodes:

```auto
discovery.zen.ping.unicast.hosts:
    - 10.128.0.23

```

This will tell the second node to look for a node on the first node's server.

Note that the name of the discovery setting has changed to `discovery.seed_hosts` in Elasticsearch 7.x.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 3, 2019, 11:23am UTC](https://discuss.elastic.co/t/i-have-created-two-instance-of-elasticsearch-in-two-different-machine-both-instance-have-same-cluster-name-but-still-no-of-nodes-is-one-but-i-want-two-node/192231/3 "2019-08-03T11:23:51Z")

</div>

Also, vitally, in 6.5.4 you _must_ set `discovery.zen.minimum_master_nodes` to `2` if you have two master-eligible nodes. If you do not then your two-node cluster could split into two one-node clusters at a later date.

---

<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:** [August 31, 2019, 11:24am UTC](https://discuss.elastic.co/t/i-have-created-two-instance-of-elasticsearch-in-two-different-machine-both-instance-have-same-cluster-name-but-still-no-of-nodes-is-one-but-i-want-two-node/192231/4 "2019-08-31T11:24:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
