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

Support Master/Slave connections using Lettuce [DATAREDIS-580] #1155

Closed
spring-projects-issues opened this issue Dec 5, 2016 · 11 comments
Closed

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Dec 5, 2016

Mark Paluch opened DATAREDIS-580 and commented

Lettuce provides a Master/Slave API that allows slave reads. Master/Slave is either configured with a static node set (well-suited for AWS ElastiCache use) or Redis Sentinel.

Master/Slave allows configuration of its read-behavior (i.e. slave reads).

connection.setReadFrom(ReadFrom.MASTER_PREFERRED);

LettuceConnectionFactory could be configured to use StatefulRedisMasterSlaveConnection and apply read preferences


Issue Links:

  • DATAREDIS-724 Support for Slave reads for lettuce
    ("is duplicated by")

  • DATAREDIS-752 Integration of Lettuce with Spring data redis and master slave strategy

  • DATAREDIS-762 Add support for static Master/Slave setups with provided nodes

  • DATAREDIS-319 Configure redis in connection factory as read only or read&write and test it
    ("supersedes")

Referenced from: pull request #287

2 votes, 5 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 9, 2017

Salil Gandhi commented

Hello,

Is there a timeline for this feature to be out? We need it as quickly as possible ...
In the meantime, I would like to pull this branch and test it out. Can you provide me access?

Thanks,
Salil Gandhi

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 9, 2017

Mark Paluch commented

Feel free to use the branch build:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-redis</artifactId>
  <version>2.1.0.DATAREDIS-580-SNAPSHOT</version>
</dependency>
 
<repositories>
  <repository>
    <id>spring-libs-snapshot</id>
    <snapshots><enabled>true</enabled></snapshots>
    <name>Springframework Maven SNAPSHOT Repository</name>
    <url>http://repo.spring.io/libs-snapshot</url>
  </repository> 
</repositories> 

Expect a GA release somewhere around next year

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 10, 2017

Salil Gandhi commented

Thank you Mark!

I will try to use this branch.

Thanks,
Salil Gandhi

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2017

Salil Gandhi commented

Hi Mark,

I am getting error while trying to download from the snapshot repository. Error is - Connection refused. Is there any special permissions required to do so?

Thanks,
Salil

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2017

Mark Paluch commented

Our repository server is publicly available. Accessing via Maven/Web browser works for me. Proxies/firewalls in front of you might change how your experience access to repo.spring.io

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2017

Salil Gandhi commented

Hi Mark,

We are getting error: Could not find artifact org.springframework.data:spring-data-redis:jar:2.1.0.DATAREDIS-580-SNAPSHOT
When I checked the repository I do not see the 580 version in the snapshot list.

http://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-redis/

Thanks,
Salil

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2017

Mark Paluch commented

Sorry for the inconvenience, the build failed that's why the artifact wasn't deployed beforehand. I fixed it,https://repo.spring.io/libs-snapshot/org/springframework/data/spring-data-redis/2.1.0.DATAREDIS-580-SNAPSHOT/ is now in place

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 14, 2017

Salil Gandhi commented

Thanks Mark! This worked..

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 26, 2018

Haitao Liu commented

Hi Mark,

I have elasicache 1 master and 2 slaves setup. I am still not sure how to pass in a list of master slave RedisURIs to construct a StatefulRedisMasterSlaveConnection for LettuceConnectionFactory. I only see support for standaloneConfiguration with single host and port.
LettuceClientConfiguration configuration = LettuceTestClientConfiguration.builder().readFrom(ReadFrom.SLAVE)
.build();
LettuceConnectionFactory factory = new LettuceConnectionFactory(SettingsUtils.standaloneConfiguration(),
configuration);

Thanks,
Haitao

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 26, 2018

Mark Paluch commented

Haitao Liu – Care to post your question on StackOverflow to make it available to a broader community?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 26, 2018

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

Successfully merging a pull request may close this issue.

None yet
2 participants