
分布式
HeatDeath
Learn by doing!
展开
-
使用Redis SETNX 命令实现分布式锁
防止多台机器上的 task 在同一时间一起执行,只要执行一个就可以了 import service.redis.RedisFacade; /** * Author: heatdeath * Date: 2018/4/24 * Desc: 基于 Redis 实现的简易分布式锁 */ public class DistributedLockUtil { pr...原创 2018-04-24 15:07:52 · 577 阅读 · 0 评论 -
分布式 Session、Session 一致性\基于 Redis 管理分布式 Session
资料: 1、分布式系统session一致性的问题 https://www.cnblogs.com/study-everyday/p/7853145.html 2、【Linux运维-集群技术进阶】集群/分布式环境下5种session处理策略 https://blog.youkuaiyun.com/u010028869/article/details/50773174?ref=myread 3、关于使用...原创 2018-05-06 00:51:01 · 1112 阅读 · 0 评论 -
一致性哈希算法的原理与实现
1、聊聊一致性哈希 https://zhuanlan.zhihu.com/p/24440059 2、我的JAVA日记(十)关于TreeMap和一致性hash https://zhuanlan.zhihu.com/p/20270435 3、简单hash算法和一致性hash算法 https://zhuanlan.zhihu.com/p/34968328 4、一致性hash算法的简单实现 ...原创 2018-05-13 21:56:36 · 292 阅读 · 0 评论 -
一个相对正确的的基于 Redis 的分布式锁
public class RedisTool { private static final String LOCK_SUCCESS = "OK"; private static final String SET_IF_NOT_EXIST = "NX"; private static final String SET_WITH_EXPIRE_TIME = "PX"; ...原创 2018-05-28 18:41:37 · 928 阅读 · 0 评论