SpringBoot integrated Lettuce connection Redis method and case

First use maven to add the following dependencies in pom.xml illustrate: SpringBoot uses the lettuce client to connect by default since 2.0. The version used this time: springboot: 2.6.6, lettuce: 6.1.8. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> Use SpringBoot to integrate Lettuce connection instance An example of Springboot + Lettuce single-connection connection to […]

io.lettuce.core.RedisCommandExecutionException: ERR operation not permitted

19:40:43.952 [http-nio-8080-exec-2] ERROR c.r.f.w.e.GlobalExceptionHandler – [handleException,83] – Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR operation not permitted org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR operation not permitted at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:268) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:799) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.setEx(LettuceStringCommands.java:232) at org.springframework.data.redis.connection.DefaultedRedisConnection.setEx(DefaultedRedisConnection.java:295) at org.springframework.data.redis.core.DefaultValueOperations$4.potentiallyUsePsetEx(DefaultValueOperations.java:268) at org.springframework.data.redis.core.DefaultValueOperations$4.doInRedis(DefaultValueOperations.java:261) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) at […]

[Solved] Redis exception; nested exception is io.lettuce.core.RedisException java.io.IOException remote host

Personal workaround: Edit /etc/ssh/sshd_config and add configuration items: ClientAliveInterval 600 ClientAliveCountMax 10 After configuration, save and restart the service: service sshd restart Here is the whole process: Local development is to find that redis is not requested after a period of time and an error will be reported: 2020/07/09 10:31:35 ERROR [com.SpringLearn.common.redis.JedisUtils] – Redis exception; […]

[Solved] nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s)

Analyze redis info parameters 1. The test environment encounters an error: 1.org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s) Resolution process: command: info used_memory_dataset_perc: The percentage of memory occupied by data After testing, about 80% of the above errors began to be reported one after another. Redis is […]

[Solved] Spring Data Redis cooperates with Lettuce client to build Adaptive updates and Periodic updates of RedisClusterClient

Knock on the blackboard! Focus! : Adaptive updates and Periodic updates Terrible topology refresh Find out why Porting code Poor topology refresh I used the company’s packaged Redis components before (the old version of Jedis was used internally). Later, the company no longer maintains the components, and each project connects itself through the open source […]

[Solved] [Solution] io.lettuce.core.RedisCommandTimeoutException: Command timed out

Follow WeChat public account “Programmer pretending to be serious” Springboot (same for spring) reports the following error during the entire redis: org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:257) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.connection.lettuce.LettuceConnection.pSubscribe(LettuceConnection.java:747) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.eventuallyPerformSubscription(RedisMessageListenerContainer.java:783) ~[spring-data-redis-2.0.5.RELEASE.jar:2.0.5.RELEASE] at […]