1.在前面的基础上,在user项目引入redis 的依赖,
<!-- redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>
2.在配置文件增加redis 配置
spring: cloud: nacos: discovery: server-addr: localhost:8848 config: server-addr: localhost:8848 file-extension: yaml #sentinel: #transport: #dashboard: localhost:8080 #port: 8719 application: name: user zipkin: base-url: http://localhost:9411 discovery-client-enabled: false sleuth: sampler: percentage: 1.0 rabbitmq: host: localhost port: 5672 username: guest password: guest datasource: url: jdbc:mysql://localhost:3306/wensentest?serverTimezone=GMT driver-class-name: com.mysql.cj.jdbc.Driver username: root password: root main: allow-bean-definition-overriding: true