Node discovery on ECS FARGATE - nodes see each other but won't join up

I'm running a Service in ECS that has two small elasticsearch tasks. It uses service discovery, so both are registered under A records in Route 53 hosted zones.

I've configured elasticsearch to use the route 53 dns as the discovery.seed_hosts value:

            {
                "value": "elasticsearch.my-ecs-cluster",
                "name": "discovery.seed_hosts"
            },

Both are configured as node.master: true.

When they start, they seem to be able to find each other, but they won't join up.
Here's the log from the ClusterFormationFailureHelper:

master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes] is empty on this node: have discovered 
[
    {ip-172-30-1-XX1.ec2.internal}{YHIoQGkeQEmwWYWUl7ga0g}{BQp-GitxRtKLp8LBEWhH8w}{172.30.1.XX1}{172.30.1.XX1:9300}{cdfhilmrstw}, 
    {ip-172-30-1-XX2.ec2.internal}{_b8yDxWuS1GkgM4_iB1wdQ}{BfJYez5ZS3G4-CHzD7QHxQ}{172.30.1.XX2}{172.30.1.XX2:9300}{cdfhilmrstw}
]; 
discovery will continue using [172.30.1.XX2:9300] from hosts providers and 
[{ip-172-30-1-XX1.ec2.internal}{YHIoQGkeQEmwWYWUl7ga0g}{BQp-GitxRtKLp8LBEWhH8w}{172.30.1.XX1}{172.30.1.XX1:9300}{cdfhilmrstw}] 
from last-known cluster state; node term 0, last-accepted version 0 in term 0

I can't configure a cluster.initial_master_nodes because I don't know what they're represented as until ECS provisions them.

How can I get them both to join up?

Any help appreciated!

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