Skip to content
Latchkey

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".

elasticsearch
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 configured

Common 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

  1. Set discovery.type=single-node in the service container environment.
  2. This skips the discovery bootstrap check and elects the node as its own master.
  3. Restart and wait for the cluster to report a status.
.github/workflows/ci.yml
services:
  opensearch:
    image: opensearchproject/opensearch:2.13.0
    env:
      discovery.type: single-node

Provide 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-node for 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →