How to run multiple nodes with esplugin / testsClusters?

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:

[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:

[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? :sweat_smile:

My build.gradle is:

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
}

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