# How to run multiple nodes with esplugin / testsClusters?

**URL:** <https://discuss.elastic.co/t/how-to-run-multiple-nodes-with-esplugin-testsclusters/279562>\
**Category:** Elasticsearch\
**Created:** [July 25, 2021, 1:15pm UTC](https://discuss.elastic.co/t/how-to-run-multiple-nodes-with-esplugin-testsclusters/279562 "2021-07-25T13:15:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dor\_Levi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dor_levi/32/89972_2.png) [@Dor\_Levi](https://discuss.elastic.co/u/Dor_Levi)\
**Post date:** [July 25, 2021, 1:15pm UTC](https://discuss.elastic.co/t/how-to-run-multiple-nodes-with-esplugin-testsclusters/279562/1 "2021-07-25T13:15:13Z")

</div>

Hi,

I'm working on a plugin for Elasticsearch, and want to try and test it in a multi-node cluster.

I'm building it with gradle and the esplugin/testcluster plugins.

Everything works great when it's just one node, but when I try to set `numberOfNodes = 2`, I'm getting errors that the nodes can't discover each other:

```auto
[2021-07-25T15:37:40,883][WARN][o.e.d.FileBasedSeedHostsProvider] [runTask-0] expected, but did not find, a dynamic hosts list at [C:\git\dor-levi\scaling-dollop\build\testclusters\runTask-0\config\unicast_hosts.txt]
[2021-07-25T15:37:41,659][WARN][o.e.d.FileBasedSeedHostsProvider] [runTask-1] expected, but did not find, a dynamic hosts list at [C:\git\dor-levi\scaling-dollop\build\testclusters\runTask-1\config\unicast_hosts.txt]

```

I tried to manually create a `unicast_hosts.txt` file in the specified location with just `127.0.0.1` in it, but I still get the following errors:

```auto
[2021-07-25T15:39:53,809][WARN][o.e.c.c.ClusterFormationFailureHelper] [runTask-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [runTask-0, runTask-1] to bootstrap a cluster: have discovered [{runTask-0}{c6QScjEYTpqitRhHFztz_A}{Lkr9fhW8Rlas6zI2Q5kZnA}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}]; discovery will continue using [] from hosts providers and [{runTask-0}{c6QScjEYTpqitRhHFztz_A}{Lkr9fhW8Rlas6zI2Q5kZnA}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-07-25T15:39:56,996][WARN][o.e.c.c.ClusterFormationFailureHelper] [runTask-1] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [runTask-0, runTask-1] to bootstrap a cluster: have discovered [{runTask-1}{aEHOHpA1TOqGGpDhAkueGg}{UpLtPEPUSH-ipM6IlH3iVQ}{127.0.0.1}{127.0.0.1:63688}{cdfhilmrstw}]; discovery will continue using [127.0.0.1:0] from hosts providers and [{runTask-1}{aEHOHpA1TOqGGpDhAkueGg}{UpLtPEPUSH-ipM6IlH3iVQ}{127.0.0.1}{127.0.0.1:63688}{cdfhilmrstw}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

```

What am I missing here? 😅

My `build.gradle` is:

```auto
import java.nio.file.Files

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath "org.elasticsearch.gradle:build-tools:${elasticsearchVersion}"
    }
}

group = 'com.dor.tests'
version = "${pluginVersion}.es.${elasticsearchVersion}-SNAPSHOT"

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.yaml-rest-test'
apply plugin: 'elasticsearch.testclusters'

licenseFile = rootProject.file('LICENSE')
noticeFile = rootProject.file('NOTICE')

processResources {
    filesMatching("**/plugin.properties") {
        expand(project.properties)
    }
}

esplugin {
  licenseFile rootProject.file('LICENSE')
  noticeFile rootProject.file('NOTICE')

  name pluginName
  description pluginDesc
  classname pluginClassname
}

validateNebulaPom.enabled = false

dependencies {
  compile "com.fasterxml.jackson.core:jackson-databind:${jacksonDataBindVersion}"
}

testClusters.matching { it.name == "runTask" }.configureEach {
  testDistribution = 'DEFAULT'
  // numberOfNodes = 2
}

```

---

<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 22, 2021, 1:15pm UTC](https://discuss.elastic.co/t/how-to-run-multiple-nodes-with-esplugin-testsclusters/279562/2 "2021-08-22T13:15:50Z")

</div>

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