zoukankan      html  css  js  c++  java
  • Redis server response timeout (3000 ms) occured after 3 retry attempts. Command: (EXISTS), params: [

    Redis server response timeout (3000 ms) occured after 3 retry attempts. Command: (EXISTS), params: [XXXX], channel: [id: 0xXXXX, L:/XXXXX.45.128:44772 - R:10.122.67.XX/10.122.67.56:6379]X

    rg.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms) occured after 3 retry attempts. Command: (HEXISTS), params: [com.dinsmooth.storehbase.schedule:entryTaskDelay, 1f15dcac-22b6-4865-92a5-a6452e6ae5c3:154], channel: [id: 0x4d120152, L:/10.255.2.30:52607 - R:172.16.0.211/172.16.0.211:6379] at org.redisson.command.RedisExecutor$3.run(RedisExecutor.java:362) at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:682) at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:757) at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:485) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748)

    误原因:客户端长时间未使用,服务端会断开

    解决办法:redisson添加配置 

    #连接间隔 心跳 pingConnectionInterval: 1000

    使用代码配置:

    package io.lenovo.ecai.portalorder.config;
    
    import org.redisson.Redisson;
    import org.redisson.api.RedissonClient;
    import org.redisson.config.Config;
    import org.redisson.spring.data.connection.RedissonConnectionFactory;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    
    @Configuration
    public class RedissonConfig {
        /**
         * 设置redisson缓存工厂,由于下面的工厂都是用的是redisson所以注意配置redissonclient
         *
         * @param client
         * @return
         */
        @Bean(name = "redissonconnectionfactory")
        public RedissonConnectionFactory getfactory(RedissonClient client) {
            return new RedissonConnectionFactory(client);
        }
    
        /**
         * redis单机配置
         *
         * @return
         */
        public RedissonClient getclient() {
            Config config = new Config();
    
            config.useSingleServer().setAddress("redis://${spring.redis.host}:${spring.redis.port}")
                    .setTimeout(1000)
                    .setRetryAttempts(3)
                    .setRetryInterval(1000)
                    .setPingConnectionInterval(1000)//**此项务必设置为redisson解决之前bug的timeout问题关键*****
                    .setDatabase(3);
            return Redisson.create(config);
        }
    }
    
    
  • 相关阅读:
    随机森林算法参数调优
    BAYES和朴素BAYES
    阿里云 金融接口 token PHP
    PHP mysql 按时间分组 表格table 跨度 rowspan
    MySql按周,按月,按日分组统计数据
    PHP 获取今日、昨日、本周、上周、本月的等等常用的起始时间戳和结束时间戳的时间处理类
    thinkphp5 tp5 会话控制 session 登录 退出 检查检验登录 判断是否应该跳转到上次url
    微信 模板消息
    php 腾讯 地图 api 计算 坐标 两点 距离 微信 网页 WebService API
    php添加http头禁止浏览器缓存
  • 原文地址:https://www.cnblogs.com/suizhikuo/p/14269260.html
Copyright © 2011-2022 走看看