node-red / node-red-docker

Repository for all things Node-RED and Docker related
Apache License 2.0
469 stars 382 forks source link

Docker prim/sec DNS failover #348

Closed p4r4ll4x closed 2 months ago

p4r4ll4x commented 1 year ago

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

hardillb commented 1 year ago

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)

p4r4ll4x commented 1 year ago

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?

hardillb commented 1 year ago

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.

bella-wmi commented 1 year ago

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 ?

hardillb commented 1 year ago

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

bella-wmi commented 1 year ago

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

p4r4ll4x commented 1 year ago

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.