欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Redis 中spark参数executor-cores引起的异常解决办法

程序员文章站 2022-03-24 10:29:22
redis 中spark参数executor-cores引起的异常解决办法 报错信息 unexpected end of stream 16/10/11 16...

redis 中spark参数executor-cores引起的异常解决办法

报错信息

unexpected end of stream

16/10/11 16:35:50 warn tasksetmanager: lost task 63.0 in stage 3.0 (tid 212, gzns-arch-spark04.gzns.iwm.name): redis.clients.jedis.exceptions.jedisconnectionexception: unexpected end of stream.
 at redis.clients.util.redisinputstream.ensurefill(redisinputstream.java:199)
 at redis.clients.util.redisinputstream.readbyte(redisinputstream.java:40)
 at redis.clients.jedis.protocol.process(protocol.java:151)
 at redis.clients.jedis.protocol.read(protocol.java:215)
 at redis.clients.jedis.connection.readprotocolwithcheckingbroken(connection.java:340)
 at redis.clients.jedis.connection.getbinarymultibulkreply(connection.java:276)
 at redis.clients.jedis.connection.getmultibulkreply(connection.java:269)
 at redis.clients.jedis.jedis.hmget(jedis.java:723)

denied redis is running in protected mode because protected mode is enabled

denied redis is running in protected mode because protected mode is enabled,
 no bind address was specified, no authentication password is requested to clients.
 in this mode connections are only accepted from the loopback interface. 
if you want to connect from external computers to redis you may adopt one of 
the following solutions: 1) just disable protected mode sending the command
 'config set protected-mode no' from the loopback interface by connecting to
 redis from the same host the server is running, however make sure redis is not 
publicly accessible from internet if you do so. use config rewrite to make this change
 permanent.
 2) alternatively you can just disable the protected mode by editing the 
redis configuration file, and setting the protected mode option to 'no', 
and then restarting the server. 3) if you started the server manually just 
for testing, restart it with the '--protected-mode no' option. 4) setup a bind 
address or an authentication password. note: you only need to do one of the above 
things in order for the server to start accepting connections from the outside.
 at redis.clients.jedis.protocol.processerror(protocol.java:127)
 at redis.clients.jedis.protocol.process(protocol.java:161)
 at redis.clients.jedis.protocol.read(protocol.java:215)

解决过程

我尝试重启redis,更换redis新jar包,关闭redis保护模式都于事无补,后来找了下错误的原因,无意中看到了unexpected end of stream是说有一个进程占用了redis的链接,头脑一炸,才发现自己把executor-cores设置为了2,然后把该值设置为1后,正常了。

看来只有等接入redis集群后,我才能修改该值了。

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!