一.在pom.xml添加依赖

<dependency>

    <groupId>redis.clients</groupId>

    <artifactId>jedis</artifactId>

    <version>2.9.0</version>

</dependency>

1.1配置单机版的redis

1)属性文件(在resources下new一个后缀为.poperties的File文件 maxTotal)

springBoot连接Redis

1.2新建一个java配置类(将上面创建好的文件引过来@ProperSource)

springBoot连接Redis

1.3测试

springBoot连接Redis

2.1集群版

1)属性文件

springBoot连接Redis

2)配置文件

springBoot连接Redis

(3)进行测试

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-07-18
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-10-24
  • 2022-12-23
相关资源
相似解决方案