美文网首页
redis 集群

redis 集群

作者: AGEGG | 来源:发表于2023-08-20 09:05 被阅读0次

CLUSTER 配置

# 开启CLUSTER
cluster-enabled yes
# 配置文件
cluster-config-file nodes.conf
# 节点超时时间
cluster-node-timeout 5000
# aof开启
appendonly yes
# 创建cluster,最后的1代表1主1从
redis-cli --cluster create 192.168.184.131:8010 192.168.184.131:8011 192.168.184.131:8012 192.168.184.131:8013 192.168.184.131:8014 192.168.184.131:8015  --cluster-replicas 1

# 查看信息
redis-cli --cluster check 192.168.184.131:8010

# 进入集群模式控制台
redis-cli -c -a 123456 -h 192.168.184.131 -p 8010

# 集群信息
cluster info
# 节点信息
cluster nodes

SpringBoot 集成Redis集群-配置

spring:
  redis:
    database: 1
    password: 123456
    cluster:
      nodes: 192.168.184.131:8010 192.168.184.131:8011 192.168.184.131:8012 192.168.184.131:8013 192.168.184.131:8014 192.168.184.131:8015

可参考:docker compose安装redis集群、集群扩容、集群收缩_cluster-announce-ip_Xiao--Y的博客-CSDN博客

相关文章

网友评论

      本文标题:redis 集群

      本文链接:https://www.haomeiwen.com/subject/rpvjmdtx.html