redisson.yml配置备份

spring:
  # redis 中间件
  redis:
    # redisson
    redisson:
      mode: single
      password: 123456a
      config: |
        # Redisson 配置
        singleServerConfig:
          address: "redis://127.0.0.1:6379"
          password: 123456
          clientName: null
          database: 15 #选择使用哪个数据库0~15
          idleConnectionTimeout: 10000
          pingTimeout: 1000
          connectTimeout: 10000
          timeout: 3000
          retryAttempts: 3
          retryInterval: 1500
          reconnectionTimeout: 3000
          failedAttempts: 3
          subscriptionsPerConnection: 5
          subscriptionConnectionMinimumIdleSize: 1
          subscriptionConnectionPoolSize: 50
          connectionMinimumIdleSize: 32
          connectionPoolSize: 64
          dnsMonitoringInterval: 5000
          #dnsMonitoring: false

        threads: 0
        nettyThreads: 0
        codec:
          class: "org.redisson.codec.JsonJacksonCodec"
        transportMode: "NIO"

一些redis的配置:

vim /usr/local/etc/redis.conf

requirepass 123456a
protected-mode no
brew services restart redis
redis-cli -h 127.0.0.1 -p 6379 -a 123456a
127.0.0.1:6379> keys *
(empty array)

redis.yml

spring:
  # redis 中间件
  redis:
    # 集群
    #cluster:
      # 节点
      #nodes: 127.0.0.1:6379
    # redis访问密码(默认为空)
    host: 127.0.0.1
    password: 123456a
    # redis数据库索引(默认为0)
    database: 0
    # redis连接超时时间(单位为毫秒)
    timeout: 60000
    # 是否开启ssl,默认开启
    ssl: false
    # redis lettuce 连接池配置,可更改为jedis,官方推荐lettuce
    lettuce:
      pool:
        # 最大可用连接数(默认为8,负数表示无限)
        max-active: 8
        # 最大空闲连接数(默认为8,负数表示无限)
        max-idle: 8
        # 最小空闲连接数(默认为0,该值只有为正数才有作用)
        min-idle: 0
        # 从连接池中获取连接最大等待时间(默认为-1,单位为毫秒,负数表示无限)
        max-wait: -1

brew install redis过程

$ brew install redis
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 1 formula.

==> Downloading https://ghcr.io/v2/homebrew/core/redis/manifests/6.2.6
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/redis/blobs/sha256:ac30519a604ff014e3903893ddca6c563c134002fec58df3613632e42c4d117c
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ac30519a604ff014e3903893ddca6c563c134002fec58df3613632e42c4d117c?se=2021-12-27T02%3A40%3A00Z&sig=GSXGt12fN%2BvtBksfTgEhyAfD%2Bp
######################################################################## 100.0%
==> Pouring redis--6.2.6.monterey.bottle.tar.gz
==> Caveats
To restart redis after an upgrade:
  brew services restart redis
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/redis/bin/redis-server /usr/local/etc/redis.conf
==> Summary
🍺  /usr/local/Cellar/redis/6.2.6: 14 files, 2.0MB
==> Running `brew cleanup redis`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值