Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Auto discovery for for multiple dbIndex in the same redis cluster #555

Open
devopsmash opened this issue Jan 21, 2024 · 3 comments

Comments

@devopsmash
Copy link

devopsmash commented Jan 21, 2024

It would be great to have the ability to auto-discover all dbIndexes in use within the same Redis cluster, rather than having to manually specify them multiple times in the configuration (like here).

in redis cli it can be detected with the command redis-cli INFO or INFO keyspace, in order to get the relevant db indexes that are in use (more info here).

@sseide
Copy link
Collaborator

sseide commented Jan 26, 2024

Auto discovery is already available for a long time via menu -> add server.
What else do you need or is not working?

And redis CLUSTER does not support multiple databases, therefor no use of auto-detection there. From Redis docs:

Redis Cluster does not support multiple databases like the standalone version of Redis. We only support database 0; the SELECT command is not allowed.

https://redis.io/docs/reference/cluster-spec/
section "Implemented subset"

@devopsmash
Copy link
Author

devopsmash commented Jan 28, 2024

Thank you @sseide for your reply.

Usually I'm using the the default_json to config my connections with something like this

  "connections": [
    {
      "label": "redis-first-db",
      "dbIndex": 0,
      "username": "myuser",
      "password": "mypass",
      "connectionName": "redis-commander",
      "optional": false,
      "clusterNoTlsValidation": false,
      "host": "redis-replication-group-stg-001.redis-replication-group-stg...",
      "port": 6379,
      "isCluster": false,
      "sentinelUsername": null,
      "sentinelPassword": "",
      "tls": {}
    },
    {
      "label": "redis-second-db",
      "dbIndex": 1,
      "username": "myuser",
      "password": "mypass",
      "connectionName": "redis-commander",
      "optional": false,
      "clusterNoTlsValidation": false,
      "host": "redis-replication-group-stg-001.redis-replication-group-stg...",
      "port": 6379,
      "isCluster": false,
      "sentinelUsername": null,
      "sentinelPassword": "",
      "tls": {}
    },

As you can see in the above configuration, I have the same redis host endpoint (in this cache AWS Elasticache), but with different dbIndex.

It will be great, if I can add 1 connection for the same redis host endpoint without mention dbIndex, and the redis-commander will be able to auto discover the existing db dbIndexes (in this case dbIndex 0 & dbIndex 1).

maybe something like this:

  "connections": [
    {
      "label": "redis-first-db",
      "dbIndex": "auto-discovery",
      "username": "myuser",
      "password": "mypass",
      "connectionName": "redis-commander",
      "optional": false,
      "clusterNoTlsValidation": false,
      "host": "redis-replication-group-stg-001.redis-replication-group-stg...",
      "port": 6379,
      "isCluster": false,
      "sentinelUsername": null,
      "sentinelPassword": "",
      "tls": {}
    },

@sseide
Copy link
Collaborator

sseide commented Feb 1, 2024

mmmh - but this kind of auto-detection would only work in the very start of Redis-Commander. Every dataabse used later for the first time is not found.

What about databases used but not holding any keys at the moment of RC startup (e.g. no temp session stored there or similar - might be the case for DEV/STG environments. Or, on system recovery where everything is setup new and RC started before other components use Redis. Using auto-Discovery here for automated setups might lead to unsuspected outcomes or a false feeling of "i see everything used"...
I would go the way to state databases used explicit on production systems.

So - if someone is going to implement the feature i will have a look at it. But no time myself for implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants