Trying to spin up 2 test nodes for Integration Testing

Hi,

I have written a ES plugin (using version ES 7.5.2) which I have been able to test successfully using a single node integration test environment. However, I have faced issues when running the same code on multiple nodes in the actual ES environment. I would like to recreate the issue locally for debugging my code, but I can't find a way to create a 2 node integration test environment.
Here is my build.gradle file

    import org.elasticsearch.gradle.testclusters.TestClustersRegistry
    import org.elasticsearch.gradle.testclusters.TestClustersPlugin

    buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath "org.elasticsearch.gradle:build-tools:7.5.2"
    }
    }

    apply plugin: 'java'
    apply plugin: 'idea'
    apply plugin: 'elasticsearch.esplugin'

    version = rootProject.file('VERSION.txt').text.trim()

    esplugin {
    description 'Elasticsearch scoring plugin'
    classname 'com.test.TestPlugin'
    name project.name
    version project.version
    licenseFile rootProject.file('LICENSE.txt')
    noticeFile rootProject.file('NOTICE.txt')
    }

    configure(rootProject) {
    TestClustersRegistry registry = rootProject.extensions.create("testClustersRegistry", TestClustersRegistry)
    TestClustersPlugin.configureClaimClustersHook(project.gradle, registry)
    TestClustersPlugin.configureStartClustersHook(project.gradle, registry)
    TestClustersPlugin.configureStopClustersHook(project.gradle, registry)
    }

    testClusters.integTest {
    testDistribution = 'DEFAULT'
    }

The 'elasticsearch.esplugin' plugin spins a node with the name 'integTest-0' under 'test clusters' in the build folder. Is there a way to create another node in the 'integTest' cluster.

Thank you very much in advance.

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