Hi,
I am evaluating dragonfly as an alternative to Redis.
I am trying to figure out installation of dragonfly as a cluster using the dragonfly k8s operator.
Could you guide me here?
Hi,
I am evaluating dragonfly as an alternative to Redis.
I am trying to figure out installation of dragonfly as a cluster using the dragonfly k8s operator.
Could you guide me here?
Hi @keshava88, welcome to the Dragonfly community.
Currently, the Dragonfly K8s Operator doesn’t support Dragonfly Cluster (the multi-node clustering) yet. The operator supports high availability (HA), though. A single Dragonfly primary instance is able to handle hundreds of GB or even 1TB of in-memory data. Depending on your workload and memory size, please let us know if a primary-replica HA setup is sufficient.
If you are already running Redis Cluster, Dragonfly supports the emulated cluster mode. It’s a single Dragonfly primary (optionally with HA as well), but compatible Redis Cluster, so that it eases your migration. To enable emulated cluster mode using the K8s operator, please see the documentation here about the args
field.
spec:
args:
- "--cluster_mode=emulated"
If you really need to scale Dragonfly horizontally, Dragonfly Cluster is currently in private beta within Dragonfly Cloud, our managed offering. Please contact us if that’s what you’re looking for.
@joezhou_df - I wonder if you could help me with a related question?
We spun up a Dragonfly with the operator on a K8s node for developer doing a .Net service which wanted a key/value store. We noticed the following output from the dragonfly logs.
CLUSTER NODES failed with reason: Cluster is disabled. Enable via passing --cluster_mode=emulated
So we added the arg --cluster_mode=emulated
to the dragonfly instances.
But we do not really understand why we saw this and what impact setting cluster_mode to emulated will have?
Is this some type of bad configuration on the client side?
The .Net client is using Redis.OM: GitHub - redis/redis-om-dotnet: Object mapping, and more, for Redis and .NET
Hi @thedukedk, let’s break the issue down:
GET
, SET
), but it also supports additional commands for cluster coordination, normally not directly called by developers. For instance, the CLUSTER NODES
command is used to retrieve the cluster configuration from a server node or instance within the cluster.CLUSTER NODES
command to gather cluster information.--cluster_mode=emulated
helps migrate from a Redis Cluster to a Dragonfly single node, and it should have negligible impact in terms of performance.--cluster_mode=emulated
should be used in Dragonfly, so that the existing cluster client works seamlessly with Dragonfly.I am not very familiar with the .NET client library, but let’s take the Go library as an example. Note that the same library supports multiple types of clients.
A single-instance (standalone) client should be created like this:
import "github.com/redis/go-redis/v9"
client := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "mypwd",
DB: 0,
})
val, err := client.Get(ctx, "key").Result()
And a cluster client is created like this:
import "github.com/redis/go-redis/v9"
client := redis.NewClusterClient(&redis.ClusterOptions{
Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"},
})
// Same usage after client initialization.
// Developers don't call commands like 'CLUSTER NODES'.
val, err := client.Get(ctx, "key").Result()
It might not be exactly the same for .NET, but you get the idea. I hope that’s clear and it solves your problem!
That clears a lot up for me. Thank you sooo much!
I am more on the operations side of things. And Dragonfly is also a bit of a new technology for us.
I can pass this information along to the developer and we can dig into how to do this correctly for a single node client.
Again, thank you for taking the time. It is very much appreciated.