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