About Replication - Why is Read-only Slave Possible?

162 views
Skip to first unread message

Sandy

unread,
Jul 27, 2012, 2:42:32 AM7/27/12
to redi...@googlegroups.com
The redis.io documents say that redis slave is read-only by default. I am curious why it's possible, because:

First, the master will send its commands(write) using also redis protocol. So the slave has to distinguish which commands are from the master and be read-only  just to clients?
Second, the slave might also be other slaves' master, so read-only possible...?

Josiah Carlson

unread,
Jul 27, 2012, 3:29:15 PM7/27/12
to redi...@googlegroups.com
It is easy to distinguish which is the master connection and which are
client connections (of any kind).

If a slave is a slave (even if it is also a master), and it is set as
read-only, then it will be read only from every client, except the
upstream master.

Regards,
- Josiah
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/_PVzqWNsQ5oJ.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.

Aaron Blohowiak

unread,
Jul 28, 2012, 3:41:58 PM7/28/12
to redi...@googlegroups.com
Another way to think of it is that the slave is a *client* to the master, but a *server* to your app.  This means the connections are very different!

fuyou

unread,
Aug 3, 2012, 8:57:14 AM8/3/12
to redi...@googlegroups.com
this is logic.as  your application to Guarantee 


2012/7/29 Aaron Blohowiak <aaron.b...@gmail.com>
Another way to think of it is that the slave is a *client* to the master, but a *server* to your app.  This means the connections are very different!

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/HZjK506mUrUJ.

To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.



--
   =============================================
                                                                             fuyou001
Best Regards
         

Josiah Carlson

unread,
Sep 6, 2012, 9:24:39 AM9/6/12
to redi...@googlegroups.com
The same way you find out if data is updated on the master:
1. You check (pull)
2. You subscribe to a channel or channel pattern, and any writes also
publish to the channel (push)

Regards,
- Josiah

On Thu, Sep 6, 2012 at 1:36 AM, Santosh <mcompu...@gmail.com> wrote:
> When data is updated on the slave, how the clients would come to know that
> the data is updated on the slave. Is there a way to know that?
> https://groups.google.com/d/msg/redis-db/-/eHqWqE6RZmUJ.
Reply all
Reply to author
Forward
0 new messages