Redis 中spark参数executor-cores引起的异常解决办法
Redis中spark参数executor-cores引起的异常解决办法
报错信息
Unexpectedendofstream
16/10/1116:35:50WARNTaskSetManager:Losttask63.0instage3.0(TID212,gzns-arch-spark04.gzns.iwm.name):redis.clients.jedis.exceptions.JedisConnectionException:Unexpectedendofstream. atredis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:199) atredis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40) atredis.clients.jedis.Protocol.process(Protocol.java:151) atredis.clients.jedis.Protocol.read(Protocol.java:215) atredis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340) atredis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:276) atredis.clients.jedis.Connection.getMultiBulkReply(Connection.java:269) atredis.clients.jedis.Jedis.hmget(Jedis.java:723)
DENIEDRedisisrunninginprotectedmodebecauseprotectedmodeisenabled
DENIEDRedisisrunninginprotectedmodebecauseprotectedmodeisenabled, nobindaddresswasspecified,noauthenticationpasswordisrequestedtoclients. Inthismodeconnectionsareonlyacceptedfromtheloopbackinterface. IfyouwanttoconnectfromexternalcomputerstoRedisyoumayadoptoneof thefollowingsolutions:1)Justdisableprotectedmodesendingthecommand 'CONFIGSETprotected-modeno'fromtheloopbackinterfacebyconnectingto Redisfromthesamehosttheserverisrunning,howeverMAKESURERedisisnot publiclyaccessiblefrominternetifyoudoso.UseCONFIGREWRITEtomakethischange permanent. 2)Alternativelyyoucanjustdisabletheprotectedmodebyeditingthe Redisconfigurationfile,andsettingtheprotectedmodeoptionto'no', andthenrestartingtheserver.3)Ifyoustartedtheservermanuallyjust fortesting,restartitwiththe'--protected-modeno'option.4)Setupabind addressoranauthenticationpassword.NOTE:Youonlyneedtodooneoftheabove thingsinorderfortheservertostartacceptingconnectionsfromtheoutside. atredis.clients.jedis.Protocol.processError(Protocol.java:127) atredis.clients.jedis.Protocol.process(Protocol.java:161) atredis.clients.jedis.Protocol.read(Protocol.java:215)
解决过程
我尝试重启redis,更换redis新jar包,关闭redis保护模式都于事无补,后来找了下错误的原因,无意中看到了Unexpectedendofstream是说有一个进程占用了redis的链接,头脑一炸,才发现自己把executor-cores设置为了2,然后把该值设置为1后,正常了。
看来只有等接入redis集群后,我才能修改该值了。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!