Search code examples
javaredisredis-sentineltest-environments

Redis sentinel with only one host


I need to setup a development environment with redis. It need to have sentinels, to replicate the behavior we have in production (because our client applications use a JedisSentinelPool to connect).

Unfortunately I only have one host available. Is it still possible to run a sentinel even though there's only one instance? Do I need to change the config?


Solution

  • Yes you can. Just start redis master, slaves and sentinels on different ports, and run them on the same machine. A redis process is lightweight - you can run them all on a single server.