redis.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # redis 配置模板
  2. # 优先从环境变量里取值
  3. shoulder:
  4. redis:
  5. ip: ${REDIS_IP:127.0.0.1}
  6. port: ${REDIS_PORT:5672}
  7. username: ${REDIS_USERNAME:shoulder} # redis6 支持用户名
  8. password: ${REDIS_PASSWORD:shoulder}
  9. database: 0
  10. spring:
  11. cache:
  12. type: GENERIC
  13. redis:
  14. host: ${shoulder.redis.ip}
  15. password: ${shoulder.redis.password}
  16. port: ${shoulder.redis.port}
  17. database: ${shoulder.redis.database}
  18. j2cache:
  19. # config-location: /j2cache.properties
  20. open-spring-cache: true
  21. cache-clean-mode: passive
  22. allow-null-values: true
  23. redis-client: lettuce
  24. l2-cache-open: true
  25. # l2-cache-open: false # 关闭二级缓存
  26. broadcast: net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
  27. # broadcast: jgroups # 关闭二级缓存
  28. L1:
  29. provider_class: caffeine
  30. L2:
  31. provider_class: net.oschina.j2cache.cache.support.redis.SpringRedisProvider
  32. config_section: lettuce
  33. sync_ttl_to_redis: true
  34. default_cache_null_object: false
  35. serialization: fst
  36. caffeine:
  37. properties: /j2cache/caffeine.properties # 这个配置文件需要放在项目中
  38. lettuce:
  39. mode: single
  40. namespace: ''
  41. storage: generic
  42. channel: j2cache
  43. scheme: redis
  44. hosts: ${shoulder.redis.ip}:${shoulder.redis.port}
  45. password: ${shoulder.redis.password}
  46. database: ${shoulder.redis.database}
  47. sentinelMasterId: ''
  48. maxTotal: 100
  49. maxIdle: 10
  50. minIdle: 10
  51. timeout: 10000