简体   繁体   中英

Redis Cluster or Replication without proxy

Is it possible to build one master (port 6378) + two slave (read only port: 6379, 6380) "cluster" on one machine and increase the performances (especially reading) and do not use any proxy? Can the site or code connect to master instance and read data from read-only nodes? Or if I use 3 instances of Redis I have to use proxy anyway?

Edit: Seems like slave nodes don't have any data, they try to redirect to master instance, but it is not correct way, am I right?

Definitely. You can code the paths in your app so writes and reads go to different servers. Depending on the programming language that you're using and the Redis client, this may be easier or harder to achieve.

Edit: that said, I'm unsure how you're running a cluster with a single master - the minimum should be 3.

You need to send a READONLY command after connecting to the slave before you could execute any read commands.

A READONLY command only affects during the current socket session which means you need this command for every TCP connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM