Redis配置说明
概览
redis:
type:standalone#:可选值:cluster,sentinel,standalone
config:
type:manual#配置类型,可选的有:manual(手动),rest(restapi配置)
host:192.168.2.5
port:6379
password:
maxIdle:500
maxTotal:500
maxWaitMillis:-1
手工搭建redis
standalone式配置
如果采用手动配置标准式redis,则核心配置为:
redis:
type:standalone
config:
type:manual
host:192.168.2.5
port:6379
password:yourpwd
maxIdle:500
maxTotal:500
maxWaitMillis:-1
集群配置
redis:
type:cluster
config:
type:manual
cluster:
nodes:ip1:6379,ip2:6379#集群节点
password:yourpwd
maxIdle:500
maxTotal:500
maxWaitMillis:-1
注:基于swarm式的可伸缩式集群,上述ip只需要配置为所有swarmnode的ip即可
哨兵配置
redis:
type:sentinel
config:
type:manual
host:192.168.2.5
sentinel:
master:mymaster#哨兵master名称
nodes:ip2:6379,ip2:6379#哨兵节点
port:6379
password:yourpwd
maxIdle:500
maxTotal:500
maxWaitMillis:-1
sohutv的cachecloud方式搭建redis
如果采用sohutv的cachecloud来管理redis,核心配置:
redis:
type:standalone
config:
type:rest
restUrl:http://ip:8585#cachecloud的restapi地址
restAppid:1000#cachecloud中的appid
restClientVersion:1.0-SNAPSHOT#不用变
连接池配置
上述就是关于redis配置方面的内容了,想了解更多详情,可以持续关注易族智汇javashop,有任何问题,欢迎一起探讨。