node-red-docker icon indicating copy to clipboard operation
node-red-docker copied to clipboard

Docker prim/sec DNS failover

Open p4r4ll4x opened this issue 2 years ago • 7 comments

What are the steps to reproduce?

Setup 2 DNS servers in docker.

What happens?

Nodered sticks to 1 of the 2 DNS servers, if that DNS server goes down, connections with DNS name fail.

What do you expect to happen?

Expected behavior is that Nodered switches to the alternate DNS server when the other goes down. Sometimes i see Nodered using the secondary DNS server and it does not switch back to the primary when the secondary goes down.

Please tell us about your environment:

2023-02-17 15_10_49-Portainer _ vDocker-2021

p4r4ll4x avatar Feb 17 '23 14:02 p4r4ll4x

Can you try with the debian based container please (you will have to build it yourself until 3.1.0 ships, instructions at https://github.com/node-red/node-red-docker/tree/master/docker-custom )

I think this might be a bug in the Alpine libc DNS resolver and not something we are likely to be able to do much about)

hardillb avatar Feb 17 '23 14:02 hardillb

Can you try with the debian based container please (you will have to build it yourself until 3.1.0 ships, instructions at https://github.com/node-red/node-red-docker/tree/master/docker-custom )

I think this might be a bug in the Alpine libc DNS resolver and not something we are likely to be able to do much about)

I prefer to wait then. When is 3.1.0 expected? Will the docker container be debian based by default from 3.1.0?

p4r4ll4x avatar Feb 17 '23 17:02 p4r4ll4x

No, we will probably be offering an additional build based on a Debian image.

There is no time frame for when 3.1.0 will ship yet, while the first beta has shipped it will depend on what bugs are found and how much time the team gets to work on things.

But please do build a the Debian based container and test it, this is only a guess based on some other DNS issues that have been seen with the Alpine based containers, without testing we have no way to know if this actually a solution and if it's not then we will end up starting from scratch once 3.1.0 ships.

hardillb avatar Feb 18 '23 09:02 hardillb

Hey, im facing similar issues with the DNS inside the node-red-docker. We are using a custom defined docker network for our node-red docker. Therefore the docker embedded DNS is used and forwards the request to the dns server configured on the host system. If we configure multiple DNS nameserver on our host system all of them get used, when increasing the dns timeout inside the docker. However the DNS record is not cached which result in multiple dns request on a request like a ping. This slows down the response time of http requests. Additionally when I start the docker container and connect it to another docker network it also does not work.

Have you seen similar behaviour ?

bella-wmi avatar Feb 20 '23 13:02 bella-wmi

@bella-wmi again, probably down to the Alpine muscl-libc DNS implementation and the same suggestion, build the Debian based container and test it.

hardillb avatar Feb 21 '23 09:02 hardillb

@hardillb tested it with the Debian based docker. It works fine. The dns is cached and it works fine.

bella-wmi avatar Feb 21 '23 09:02 bella-wmi

No, we will probably be offering an additional build based on a Debian image.

There is no time frame for when 3.1.0 will ship yet, while the first beta has shipped it will depend on what bugs are found and how much time the team gets to work on things.

But please do build a the Debian based container and test it, this is only a guess based on some other DNS issues that have been seen with the Alpine based containers, without testing we have no way to know if this actually a solution and if it's not then we will end up starting from scratch once 3.1.0 ships.

I try to find some time soon to test this. My issue is not the same as what @bella-wmi is reporting.

p4r4ll4x avatar Feb 21 '23 12:02 p4r4ll4x