Discussion:
[redis-db] ServiceStack.Redis example?
Kevin Burton
2015-01-28 00:43:47 UTC
Permalink
I have looked at the source and tried to Google but I have been unable to
find a good example of how to use ServiceStack.Redis code in my
application. I have three sentinels, one master, and one slave. All of the
sentinels are monitoring the one master. My initial attempt is to have all
of the sentinels pooled together in a PooledRedisClientManager but the
problem is that PooledRedisClientManager.GetClient() returns an interface
IRedisClient which is missing the sentinel "commands". I could use the
Custom method and issue SENTINEL commands but why are the methods
(specifically Sentinel) in the class but not part of the interface? Then
there is the RedisSentinel class but the one method that this class lacks
is the ability to get information about the current master (since a
sentinels job is to convert a slave to a master, right?). The class takes
as arguments to the constructor an enumeration of "hosts". I am assuming
that the enumeration of strings that describes a host is one of the
"connection string" formats. The second argument to the constructor is a
name given to the sentinel. Is this the name of the sentinel associated
with one of the host "connection strings"? How is it known which of the
hosts this "name" should be associated with.

Obviously, I don't understand the intent behind all of the code developed
for ServiceStack.Redis. I am confident that given the right perspective
there is code to support my needs. Any examples?

Thank you.

Kevin
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Demis Bellot
2015-01-28 08:16:00 UTC
Permalink
RedisSentinel hasn't officially been announced so there's no official
documentation for it yet, but this answer is a good starting point showing
how it can be used: http://stackoverflow.com/a/28133657/85785

- Demis
Post by Kevin Burton
I have looked at the source and tried to Google but I have been unable to
find a good example of how to use ServiceStack.Redis code in my
application. I have three sentinels, one master, and one slave. All of the
sentinels are monitoring the one master. My initial attempt is to have all
of the sentinels pooled together in a PooledRedisClientManager but the
problem is that PooledRedisClientManager.GetClient() returns an interface
IRedisClient which is missing the sentinel "commands". I could use the
Custom method and issue SENTINEL commands but why are the methods
(specifically Sentinel) in the class but not part of the interface? Then
there is the RedisSentinel class but the one method that this class lacks
is the ability to get information about the current master (since a
sentinels job is to convert a slave to a master, right?). The class takes
as arguments to the constructor an enumeration of "hosts". I am assuming
that the enumeration of strings that describes a host is one of the
"connection string" formats. The second argument to the constructor is a
name given to the sentinel. Is this the name of the sentinel associated
with one of the host "connection strings"? How is it known which of the
hosts this "name" should be associated with.
Obviously, I don't understand the intent behind all of the code developed
for ServiceStack.Redis. I am confident that given the right perspective
there is code to support my needs. Any examples?
Thank you.
Kevin
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Kevin Burton
2015-01-28 14:33:06 UTC
Permalink
Thank you. This is a big help. I still have a remaining question with
failover. If the master which the sentinels are monitoring fails will
GetClient() method on the pool return IRedisClient for the new master? When
do you need to explicitly call FailovertoSentinelHosts?

Thanks again

Kevin
Post by Demis Bellot
RedisSentinel hasn't officially been announced so there's no official
documentation for it yet, but this answer is a good starting point showing
how it can be used: http://stackoverflow.com/a/28133657/85785
- Demis
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Loading...