RedissonManager 在初始化时如果redis服务有密码认证,此时该如何设置进来
来源:16-2 Redisson初始化

qq_心有智行有向_0
2018-05-04
@PostConstruct
private void init(){
try {
config.useSingleServer().setAddress(new StringBuilder().append(redis1Ip).append(":").append(redis1Port).toString());
redisson = (Redisson) Redisson.create(config);
log.info("初始化Redisson结束");
} catch (Exception e) {
log.error("redisson init error",e);
}
}
写回答
1回答
-
Geely
2018-05-06
你好同学,调用一下config.方法,里面有设置密码的方法。
00
相似问题