Skip to content

Add support for Redis clustering #171

@jdeppe-pivotal

Description

@jdeppe-pivotal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions