Elasticsearch "unsuitable for production" discovery settings in CI
Elasticsearch refuses to start a "production" node that has none of discovery.seed_hosts, discovery.seed_providers, or cluster.initial_master_nodes set. For a single-node CI service the fix is to declare single-node discovery so no seeds are needed.
What this error means
The container exits during startup with "the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured".
bootstrap check failure [1] of [1]: the default discovery settings are unsuitable
for production use; at least one of [discovery.seed_hosts, discovery.seed_providers,
cluster.initial_master_nodes] must be configuredCommon causes
A production node with no discovery configuration
Binding a published port puts the node in production mode, where the discovery bootstrap check requires at least one seed or initial-master setting.
Single-node discovery was not declared
Without discovery.type=single-node, Elasticsearch assumes it should join a multi-node cluster and demands seed configuration.
How to fix it
Declare single-node discovery
- Set
discovery.type=single-nodein the service container environment. - This skips the discovery bootstrap check and elects the node as its own master.
- Restart and wait for the cluster to report a status.
services:
opensearch:
image: opensearchproject/opensearch:2.13.0
env:
discovery.type: single-nodeProvide seed hosts only for a real cluster
If you intend a multi-node cluster, set discovery.seed_hosts and cluster.initial_master_nodes instead of single-node mode.
How to prevent it
- Use
discovery.type=single-nodefor every single-node test service. - Reserve seed-host configuration for genuine multi-node topologies.
- Keep the CI cluster as small as the tests actually require.