You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
opsli-boot/opsli-plugins/opsli-plugins-redisson
Carina 93f95ce21b
fix: 修复Redisson 解锁异常问题
3 years ago
..
src/main fix: 修复Redisson 解锁异常问题 3 years ago
README.md 新加入 redisson 分布式锁 4 years ago
pom.xml 新加入 redisson 分布式锁 4 years ago

README.md

application.properties配置方式(yaml同理)

redisson分布式锁配置--单机

    redisson.lock.server.address=127.0.0.1:6379
    redisson.lock.server.type=standalone
    redisson.lock.server.password=
    redisson.lock.server.database=1

redisson分布式锁配置--哨兵

redisson.lock.server.address 格式为: sentinel.conf配置里的sentinel别名,sentinel1节点的服务IP和端口sentinel2节点的服务IP和端口sentinel3节点的服务IP和端口
比如sentinel.conf里配置为sentinel monitor my-sentinel-name 127.0.0.1 6379 2,那么这里就配置my-sentinel-name

    redisson.server.address=my-sentinel-name,127.0.0.1:26379,127.0.0.1:26389,127.0.0.1:26399
    redisson.server.type=sentinel
    redisson.lock.server.password=
    redisson.lock.server.database=1

redisson分布式锁配置--集群方式

cluster方式至少6个节点(3主3从3主做sharding3从用来保证主宕机后可以高可用)
地址格式为: 127.0.0.1:6379,127.0.0.1:6380,127.0.0.1:6381,127.0.0.1:6382,127.0.0.1:6383,127.0.0.1:6384

    redisson.server.address=127.0.0.1:6379,127.0.0.1:6380,127.0.0.1:6381,127.0.0.1:6382,127.0.0.1:6383,127.0.0.1:6384
    redisson.server.type=cluster
    redisson.lock.server.password=
    redisson.lock.server.database=1

redisson分布式锁配置--主从

地址格式为主节点,子节点,子节点
比如:127.0.0.1:6379,127.0.0.1:6380,127.0.0.1:6381
代表主节点:127.0.0.1:6379从节点127.0.0.1:6380127.0.0.1:6381

    redisson.server.address=127.0.0.1:6379,127.0.0.1:6380,127.0.0.1:6381
    redisson.server.type=masterslave
    redisson.lock.server.password=
    redisson.lock.server.database=1