dotNext: Network.ToEndPoint method does not seem to support a dns based endpoint

Hello,

I am trying to change my cluster to run in containers and am having a problem with configuring the members. Since docker assigns them their own IPs and makes the nodes available through a dns system (eg https://mydockerraftnodeservice), I have configured the members collection to use the service name. However, when I attempt to bring up the cluster, the constructor of the RaftClusterMember class tries to convert the member to an endpoint and fails since it is not a loopback endpoint:

internal static IPEndPoint? ToEndPoint(this Uri memberUri)
{
    switch (memberUri.HostNameType)
    {
        case UriHostNameType.IPv4:
        case UriHostNameType.IPv6:
            return new IPEndPoint(IPAddress.Parse(memberUri.Host), memberUri.Port);
        case UriHostNameType.Dns:
            return memberUri.IsLoopback ? new IPEndPoint(IPAddress.Loopback, memberUri.Port) : null;
        default:
            return null;
    }
}

This is a problem since I do not know the IPs of the containers ahead of time and since the standard way to refer to the containers is through dns.

Do you have any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 55

Most upvoted comments

Everything is merged with develop branch.

Ok, let’s summarize the upcoming work from my side:

  • I’ll add hostNameHint configuration property
  • Async local member selector is already implemented in branch dns-support-3.x. I need to merge it to develop branch.
  • I cannot add GetReader to IRaftLogEntry interface because it’s not recommended way to decode log entries due to performance reasons (boxing or instantiation of the object for each log entry on high workload produces a lot of garbage).

Not sure that publishing of 3.x as pre-release is a good idea. It will take the time. I’d rather spend the time preparing the final release. Anyway, I’ll think about this.