简体   繁体   English

只有一台主机的Redis哨兵

[英]Redis sentinel with only one host

I need to setup a development environment with redis.我需要用redis设置一个开发环境。 It need to have sentinels, to replicate the behavior we have in production (because our client applications use a JedisSentinelPool to connect).它需要有哨兵,以复制我们在生产中的行为(因为我们的客户端应用程序使用 JedisSentinelPool 进行连接)。

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?我需要更改配置吗?

Yes you can.是的你可以。 Just start redis master, slaves and sentinels on different ports, and run them on the same machine.只需在不同端口启动redis master、slave和sentinel,在同一台机器上运行即可。 A redis process is lightweight - you can run them all on a single server. redis 进程是轻量级的 - 您可以在单个服务器上运行它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM