springboot连接Redis集群

标题

# 应用服务 WEB 访问端口
server:
  port: 8888

spring:
  redis:
    password: admin
    lettuce:
      pool:
        max-active: 8
        max-wait: -1ms
        max-idle: 8
        min-idle: 0
      cluster:
        refresh:
          adaptive: true
          period: 2000
    cluster:
      max-redirects: 3
      nodes:
        - 47.120.0.38:6379
        - 47.120.0.38:6380
        - 47.120.0.38:6381
        - 47.120.0.38:6382
        - 47.120.0.38:6383
        - 47.120.0.38:6384

redis中配置文件中重要内容,否则报连接超时错误

cluster-announce-ip 47.120.0.38
cluster-announce-bus-port 16379
cluster-announce-port 6379

你可能感兴趣的:(spring,boot,redis,后端)