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

Add support for Redis clustering #171

Open
jdeppe-pivotal opened this issue Nov 23, 2021 · 1 comment
Open

Add support for Redis clustering #171

jdeppe-pivotal opened this issue Nov 23, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jdeppe-pivotal
Copy link
Member

jdeppe-pivotal commented Nov 23, 2021

Similar to #32, I'd like to propose adding support for Redis clustering to java-cfenv. Since Redis clustering allows for node discovery via the various CLUSTER commands, there is greater flexibility in how cluster support can be signaled. One nice aspect is that only a single node need be provided in order for additional nodes to be discovered.

For spring-data-redis to enable clustering, I believe it is only required that the property spring.redis.cluster.nodes be set.

Here are some proposals on how this could be implemented:

  • If the service instance tag also contains the word cluster, (in addition to redis), then the uri is used to determine a host:port to set in spring.redis.cluster.nodes.
  • If the uri scheme is either redis-cluster or rediss-cluster, then the uri is used to determine the host:port of the cluster.
  • An additional array of redis_nodes is provided; for example:
"redis_nodes": [
  {
    "hostname": "x.x.x.x",
    "port": "xxxx"
  },
  {
    "hostname": "x.x.x.x",
    "port": "xxxx"
  }
]

I'd be happy to provide a PR for this work.

@pivotal-david-osullivan pivotal-david-osullivan added the enhancement New feature or request label Apr 7, 2022
@pivotal-david-osullivan
Copy link
Member

Hi @jdeppe-pivotal, thanks for the suggestion, apologies for the delay in response.

Do you have some examples of service instance JSON which include the cluster tag or redis-cluster URI scheme you mentioned as possible implementation solutions?

These would need to exist in service bindings so that they could be identified and processed by the library.

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

No branches or pull requests

2 participants