redis-sentinel

Correct @EnableRedisHttpSession configuration with Redis Sentinel

安稳与你 提交于 2019-12-06 06:15:22
I have a Spring Cloud based application with multiple backend Spring-Boot servers. The servers are all sharing their session with a Redis server via @EnableRedisHttpSession. I'm trying to configure the application with master-slave configuration and Redis Sentinel. My setup is 1 master, two slaves, and 3 sentinels. I keep getting issues with the environment. At first, I was getting an error saying that my slave it READONLY. So I had to set all slaves to READWRITE. Then, I still got this error. Turns out that when a slave was promoted to master, the old master was turned into slave, with the

Using jedis how to write to a specific slot/node in redis cluster

筅森魡賤 提交于 2019-12-06 06:03:45
I'm trying to improve the performance of writing data to redis cluster. We are planning to move from redi-sentinel to cluster mode for scalability. But, the performance of write operations is very less compared to redis-sentinel. We leveraged pipeline in redis-sentinel but cluster mode doesn't support pipeline. So, I was thinking to group all the keys that go to a same node and send the batch to that specific node using pipeline. So, I'm wondering how to know/compute (before writing to cluster) to which node/slot a particular key would be written to? Solution 1: Found a solution to identify

redis-sentinel-哨兵集群-简单部署

时光怂恿深爱的人放手 提交于 2019-12-06 01:51:57
Redis Sentinel的主要功能 Sentinel 的主要功能包括 主节点存活检测、主从运行情况检测、自动故障转移 (failover)、主从切换。Redis 的 Sentinel 最小配置是 一主一从。 Redis 的 Sentinel 系统可以用来管理多个 Redis 服务器,该系统可以执行以下四个任务: 监控 Sentinel 会不断的检查 主服务器 和 从服务器 是否正常运行。 通知 当被监控的某个 Redis 服务器出现问题,Sentinel 通过 API 脚本 向 管理员 或者其他的 应用程序 发送通知。 自动故障转移 当 主节点 不能正常工作时,Sentinel 会开始一次 自动的 故障转移操作,它会将与 失效主节点 是 主从关系 的其中一个 从节点 升级为新的 主节点,并且将其他的 从节点 指向 新的主节点。 配置提供者 在 Redis Sentinel 模式下,客户端应用 在初始化时连接的是 Sentinel 节点集合,从中获取 主节点 的信息。 主观下线和客观下线 默认情况下,每个 Sentinel 节点会以 每秒一次 的频率对 Redis 节点和 其它 的 Sentinel 节点发送 PING 命令,并通过节点的 回复 来判断节点是否在线。 主观下线 主观下线 适用于所有 主节点 和 从节点。如果在 down-after-milliseconds 毫秒内

ServiceStack.Redis.Sentinel Usage

霸气de小男生 提交于 2019-12-04 14:42:19
问题 I'm running a licensed version of ServiceStack and trying to get a sentinel cluster setup on Google Cloud Compute. The cluster is basically GCE's click-to-deploy redis solution - 3 servers. Here is the code i'm using to initialize... var hosts = Settings.Redis.Host.Split(';'); var sentinel = new ServiceStack.Redis.RedisSentinel(hosts, "master"); redis = sentinel.Setup(); container.Register<IRedisClientsManager>(redis); container.Register<ICacheClient>(redis.GetCacheClient()); The client works

Redis sentinel docker image / Dockerfile

可紊 提交于 2019-12-03 09:48:18
问题 I'm looking to deploy high availability Redis on a coreOS cluster, and I need a Redis Sentinel docker image (i.e. Dockerfile) that works. I've gathered enough information/expertise to create one (I think)... but my limited knowledge/experience with advanced networking is the only thing keeping me from building and sharing it. Can someone who is an expert here help me developing a Redis Sentinel Dockerfile (none exist right now)? The Redis/Docker community would really benefit from this. Here

ServiceStack.Redis.Sentinel Usage

放肆的年华 提交于 2019-12-03 09:10:36
I'm running a licensed version of ServiceStack and trying to get a sentinel cluster setup on Google Cloud Compute. The cluster is basically GCE's click-to-deploy redis solution - 3 servers. Here is the code i'm using to initialize... var hosts = Settings.Redis.Host.Split(';'); var sentinel = new ServiceStack.Redis.RedisSentinel(hosts, "master"); redis = sentinel.Setup(); container.Register<IRedisClientsManager>(redis); container.Register<ICacheClient>(redis.GetCacheClient()); The client works fine - but once i shut down one of the redis instances everything craps the bed. The client complains

Redis sentinels in same servers as master/slave?

一笑奈何 提交于 2019-12-03 03:31:49
I've been doing some reading on how to use Redis Sentinel, and I know it's possible to have 2 or more sentinels, and load balance between them when calling from the client side. Is it good practice to have these 2 sentinels in the same server as my master + slave? In other words, have 1 sentinel in the same physical server as master, and another in same physical server as slave? It seems to me if the master server dies, the sentinel in the slave will simply promote the slave to a master. if the slave server dies, it doesn't matter because the master is still up. Am I missing something? What

Redis sentinel docker image / Dockerfile

风格不统一 提交于 2019-12-03 00:15:40
I'm looking to deploy high availability Redis on a coreOS cluster, and I need a Redis Sentinel docker image (i.e. Dockerfile) that works. I've gathered enough information/expertise to create one (I think)... but my limited knowledge/experience with advanced networking is the only thing keeping me from building and sharing it. Can someone who is an expert here help me developing a Redis Sentinel Dockerfile (none exist right now)? The Redis/Docker community would really benefit from this. Here's the broader issue and context: https://github.com/antirez/redis/pull/1908 I think the solution is

高可用 Redis 服务架构分析与搭建

不打扰是莪最后的温柔 提交于 2019-11-30 14:38:10
基于内存的Redis应该是目前各种web开发业务中最为常用的key-value数据库了,我们经常在业务中用其存储用户登陆态(Session存储),加速一些热数据的查询(相比较mysql而言,速度有数量级的提升),做简单的消息队列(LPUSH和BRPOP)、订阅发布(PUB/SUB)系统等等。 规模比较大的互联网公司,一般都会有专门的团队,将Redis存储以基础服务的形式提供给各个业务调用。 不过任何一个基础服务的提供方,都会被调用方问起的一个问题是:你的服务是否具有高可用性?最好不要因为你的服务经常出问题,导致我这边的业务跟着遭殃。最近我所在的项目中也自己搭了一套小型的“高可用”Redis服务,在此做一下自己的总结和思考。 首先我们要定义一下对于Redis服务来说怎样才算是高可用,即在各种出现异常的情况下,依然可以正常提供服务。或者宽松一些,出现异常的情况下,只经过很短暂的时间即可恢复正常服务。所谓异常,应该至少包含了以下几种可能性: 【异常1】某个节点服务器的某个进程突然down掉(例如某开发手残,把一台服务器的redis-server进程kill了) 【异常2】某台节点服务器down掉,相当于这个节点上所有进程都停了(例如某运维手残,把一个服务器的电源拔了;例如一些老旧机器出现硬件故障) 【异常3】任意两个节点服务器之间的通信中断了(例如某临时工手残

[喵咪Redis]Redis安装与介绍

▼魔方 西西 提交于 2019-11-29 21:56:19
#[喵咪Redis]Redis安装与介绍 ##前言## 哈喽大家好啊,这次要来和大家一起来了解学习Redis的一系列技术,最终目的是搭建一个高可用redis集群自动负载灾备,那我们先从最基础的Redis的一些基本介绍以及安装来说起! 附上: 喵了个咪的博客: w-blog.cn Redis官网: http://redis.io/ Redis命令大全: http://doc.redisfans.com/ Redsi源码地址: http://download.redis.io/releases/ GitHub地址: https://github.com/antirez/redis ##1. Redis是什么?解决什么问题?## ##1.1 Redis是什么 摘录百度百科介绍 Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,Redis支持丰富的value类型如string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作. Redis 是一个高性能的key-value数据库。 redis的出现,很大程度补偿了memcached这类key/value存储的不足,在部