Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to

org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost/:6379

sprngboot整合redis很简单,之前使用也没有什么问题,基本操作通过redistemplate实现的,配置一下序列化方式就行,一般使用阿里的fastjson。当然也可以使用比较火的fastjson2。
至于yml的配置比较简单,不多赘述
序列化:

  @Bean
    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory){
   
        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();

        redisTemplate.setConnectionFactory(redisConnectionFactory)

你可能感兴趣的:(redis,redis,java)