Strange Issue: from redis-py client

1,463 views
Skip to first unread message

Pradeep Chhetri

unread,
Oct 29, 2013, 6:15:08 PM10/29/13
to redi...@googlegroups.com
Hello all,

I was trying out redis-py client along with sentinel and found the following thing:

* I have two redis-servers instances running at port 6379, 6380 on the same box and two sentinels running at 26379, 26380 ports at the same  box.

From the redis machine:

>>> from redis.sentinel import Sentinel
>>> sentinel = Sentinel([('localhost',26379),('localhost',26380)],socket_timeout=0.1)
>>> sentinel.discover_master('mymaster')
('127.0.0.1', 6380)
>>> sentinel.discover_slaves('mymaster')
[('127.0.0.1', 6379)]

From another machine:

>>> from redis.sentinel import Sentinel
>>> sentinel = Sentinel([('pradeep-test.stage',23679),('pradeep-test.stage',23680)],socket_timeout=0.1)
>>> sentinel.discover_master('mymaster')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "redis/sentinel.py", line 149, in discover_master
    raise MasterNotFoundError("No master found for %r" % (service_name,))
redis.sentinel.MasterNotFoundError: No master found for 'mymaster'
>>> sentinel.discover_slaves('mymaster')
[]
Can someone explain me why i am getting like this. Am I doing something wrong ?

Regards,

- Pradeep

Pradeep Chhetri

unread,
Oct 29, 2013, 6:20:51 PM10/29/13
to redi...@googlegroups.com
Sorry, it was my typing error. I put wrong port (23679 instead of
26379).

On Wed Oct 30 03:45:08 2013, Pradeep Chhetri wrote:
> Hello all,
>
> I was trying out redis-py client along with sentinel and found the
> following thing:
>
> * I have two redis-servers instances running at port 6379, 6380 on the
> same box and two sentinels running at 26379, 26380 ports at the same box.
> _
> _
> _ From the redis machine:_
>
> >>> from redis.sentinel import Sentinel
> >>> sentinel = Sentinel([('localhost',26379),('localhost',26380)],socket_timeout=0.1)
> >>> sentinel.discover_master('mymaster')
> ('127.0.0.1', 6380)
> >>> sentinel.discover_slaves('mymaster')
> [('127.0.0.1', 6379)]
>
> _ From another machine:_
Reply all
Reply to author
Forward
0 new messages