异常信息:
java.lang.RuntimeException: redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
at backtype.storm.daemon.executor$fn__6214$fn__6227$fn__6278.invoke(executor.clj:808)
at backtype.storm.util$async_loop$fn__543.invoke(util.clj:475) at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:745)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:198)
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
at redis.clients.jedis.Protocol.process(Protocol.java:141)
at redis.clients.jedis.Protocol.read(Protocol.java:205)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:233)
at redis.clients.jedis.Jedis.keys(Jedis.java:194)
at com.jk.utils.RedisUtils.keys(RedisUtils.java:174)
at com.jk.bolt.IPSumBolt.execute(IPSumBolt.java:47) (异常代码:Set<String> keys = jedis.keys("2017"))
at backtype.storm.daemon.executor$fn__6214$tuple_action_fn__6216.invoke(executor.clj:670)
at backtype.storm.daemon.executor$mk_task_receiver$fn__6137.invoke(executor.clj:426)
at backtype.storm.disruptor$clojure_handler$reify__5713.onEvent(disruptor.clj:58)
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125) ... 6 more
解决方案:
首先网上有很多,比如客户端缓冲区大小,但是试过之后依然没有解决。
我们用的是两台Redis服务器节点,使用Codis代理搭建的Redis集群服务,最后经一一排查代码,发现是Codis代理不支持redis keys这种模糊查询操作,改用 scan操作发现codis 貌似也不支持。