dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

IPv6 Support

Open kirinnee opened this issue 1 year ago • 4 comments

Describe the bug Trying to use DragonflyDB in Kubernetes with IPv6, but it says IPv6 not supported

To Reproduce

  1. Have IPv6 only cluster (EKS)
  2. Install via helm

Expected behavior Should work

Screenshots

I20230313 04:52:24.861320     1 init.cc:56] dragonfly running in opt mode.
I20230313 04:52:24.861382     1 dfly_main.cc:467] Starting dragonfly df-v0.17.0-a3b5f0b54a6703d9571ef1a78b27da1cdb215cd3
I20230313 04:52:24.861398     1 dfly_main.cc:490] maxmemory has not been specified. Deciding myself....
I20230313 04:52:24.861441     1 dfly_main.cc:495] Found 60.63GiB available memory. Setting maxmemory to 48.50GiB
I20230313 04:52:24.861937     8 proactor.cc:413] IORing with 1024 entries, allocated 102720 bytes, cq_entries is 2048
I20230313 04:52:24.862672     1 proactor_pool.cc:66] Running 8 io threads
I20230313 04:52:24.863550     1 server_family.cc:420] Data directory is "/data"
E20230313 04:52:24.863865     1 accept_server.cc:98] Error resolving address [0::0]: Name or service not known
E20230313 04:52:24.863886     1 dfly_main.cc:352] Could not open port 6379, error: Cannot assign requested address

Environment (please complete the following information):

Reproducible Code Snippet

Additional context Tried using bind to bind to IPv6:

  • ::
  • 0::0
  • [::]
  • [0::0]

kirinnee avatar Mar 13 '23 04:03 kirinnee

Hey @kirinnee nice to meet you!

Out of curiosity, why do you guys use IPv6 in the internal network? Does it have any advantages over IPv4?

Regarding the issue - the primary barrier right now - I do not have an IPv6 dev machine (not a devop, so not sure how to set up one).

romange avatar Mar 13 '23 07:03 romange

hey @romange , thanks for the reply!

IPv4 Private subnet is restricted to 24 bits, which can be restrictive because we have to share this 24 bits with:

  • service, pods, nodes
  • availability zones
  • subnets
  • intra-cluster peering (that does not allow overlaps)

Furthermore, it is currently a hard limitation on the number of pods in Kubernetes in EKS, too. The world is moving towards IPv6 as the default due to the depletion of IPv4 addresses, and lastly, you get uniquely addressable pods, nodes, without needing to figure out network layers.

What dev machine do you use? Perhaps I can help with that!

kirinnee avatar Mar 13 '23 08:03 kirinnee

I use AWS/GCP clouds. and I use this pipeline to bake my dev images https://github.com/romange/image-bakery

Basically, my dev machine is based on ubuntu22.10 with more or less these packages installed:

https://github.com/dragonflydb/dragonfly/blob/main/tools/docker/Dockerfile.ubuntu-dev#L8

but I am not even sure if it's an image issue or VPC config.

But if you ask about my dev hardware requirements (not sure what you have in mind :) ) - they are modest: 4 cores with 16GB RAM will suffice, x86 or aarch64, preferably ubuntu 22.04+ or debian 11+.

romange avatar Mar 13 '23 08:03 romange

we should scan for inet_ntop calls in the codebase

romange avatar Mar 15 '23 07:03 romange

Binding to a IPv6 address works now, still need to support IPv6 addresses in REPLICAOF.

royjacobson avatar Apr 13 '23 07:04 royjacobson