当前位置 > it书童 > java > 正文

springboot 集成 redis 集群

java it书童 2020-12-19 11:40:42 0赞 0踩 784阅读 0评论

配置:

spring:
  redis:
    cluster:
      nodes: 192.168.1.171:6379,192.168.1.172:6379,192.168.1.173:6379,192.168.1.151:6379,192.168.1.152:6379,192.168.1.153:6379

测试:

http://localhost:8088/redis/set?key=addr&value=guangzhou

$ redis-cli -c -h 192.168.1.152 -p 6379
192.168.1.171:6379> get addr
-> Redirected to slot [12790] located at 192.168.1.173:6379
"guangzhou"
关于我
一个文科出身的程序员,追求做个有趣的人,传播有价值的知识,微信公众号主要分享读书思考心得,不会有代码类文章,非程序员的同学请放心订阅
转载须注明出处:https://www.itshutong.com/articles/976