New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown setting 'discovery.zen.minimum_master_nodes' in elasticsearch testcontainer 8.x #228
Comments
Do you know whether simply removing |
This setting is ignored in Elasticsearch 7. (https://www.elastic.co/blog/a-new-era-for-cluster-coordination-in-elasticsearch). So yes, this can easily be removed. I tried with 7.17.5, and it worked. As for version 6: I get an error message during start-up.
When I set the kernel parameter to a higher value, this works again. But I think it is better to keep I am always nervous about this kind of change. Since there are only few supported major versions at any time, (currently, 6, 7, 8). I do not think it would hurt to have a set of setting for each version. So, I would do the following changes:
|
Nice, thanks for digging into this. Your proposal of submitting a PR that checks for the version and sets environment variables appropriately sounds great! |
I have done a small PR and added the three currently supported versions to the tests. They seem to be doing fine. |
Fixed in #232. |
I am trying to start the testcontainers with a new 8.x elasticsearch image with testcontainers 3.6.0.
However, the container quits immediately, and I cannot execute any tests.
I found out that the
discovery.zen.*
settings are no longer supported and will cause the container to quit now. ES 8 breaking changesAlso, the check if the container is up will not work properly. I assume this is because Elasticsearch will use https now by default. I did not find anything in the changelogs, but there is a comment in the Java testcontainers here [ElasticsearchContainer.java] "major version 8 is secure by default" (https://github.com/testcontainers/testcontainers-java/blob/84d3444600aaeeac6813505fe5bfbf9ffce760ef/modules/elasticsearch/src/main/java/org/testcontainers/elasticsearch/ElasticsearchContainer.java#L178)
Here is the error message that I get.
In order for the container to start, I need to change the environment variables as follows:
This does not work
If I remove the environment variable, this code works
I could prepare a Pull Request in which I check whether the version of the container is 8 or higher and set the environment variables accordingly. Does this sound like the correct approach?
The text was updated successfully, but these errors were encountered: