使用Spark的间歇超时异常

 mobiledu2502927445 发布于 2022-12-10 13:12

我有一个包含10个节点的Spark集群,并且在第一次使用Spark Context之后我得到了这个异常:

14/11/20 11:15:13 ERROR UserGroupInformation: PriviledgedActionException as:iuberdata (auth:SIMPLE) cause:java.util.concurrent.TimeoutException: Futures timed out after [120 seconds]
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException: Unknown exception in doAs
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1421)
    at org.apache.spark.deploy.SparkHadoopUtil.runAsSparkUser(SparkHadoopUtil.scala:52)
    at org.apache.spark.executor.CoarseGrainedExecutorBackend$.run(CoarseGrainedExecutorBackend.scala:113)
    at org.apache.spark.executor.CoarseGrainedExecutorBackend$.main(CoarseGrainedExecutorBackend.scala:156)
    at org.apache.spark.executor.CoarseGrainedExecutorBackend.main(CoarseGrainedExecutorBackend.scala)
Caused by: java.security.PrivilegedActionException: java.util.concurrent.TimeoutException: Futures timed out after [120 seconds]
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
    ... 4 more

这家伙有类似的问题,但我已经尝试过他的解决方案并没有奏效.

同样的异常也发生在这里,但问题不在于它们在这里我在主服务器或从服务器和客户端都使用spark版本1.1.0.

我试图将超时增加到120秒,但它仍然无法解决问题.

我通过脚本整合环境,我使用context.addJar将我的代码包含在类路径中.这个问题是间歇性的,我不知道如何跟踪它为什么会发生.任何人在配置一个知道如何解决它的火花簇时遇到过这个问题?

2 个回答
  • 我们遇到了类似的问题,很难调试和隔离.长话短说 - Spark使用Akka,这对解析IP地址的FQDN主机名非常挑剔.即使您在所有位置指定IP地址也是不够的.这里的答案帮助我们解决了问题.

    运行的有用测试netcat -l <port>在主服务器上运行,nc -vz <host> <port>并在工作程序上运行以测试连接.使用IP地址和FQDN运行测试.您可以从下面的日志片段中的WARN消息中获取Spark正在使用的名称.对我们来说是host032s4.staging.companynameremoved.info.我们的IP地址测试通过,FQDN测试失败,因为我们的DNS设置不正确.

    INFO 2015-07-24 10:33:45 Remoting: Remoting started; listening on addresses :[akka.tcp://driverPropsFetcher@10.40.246.168:35455]
    INFO 2015-07-24 10:33:45 Remoting: Remoting now listens on addresses: [akka.tcp://driverPropsFetcher@10.40.246.168:35455]
    INFO 2015-07-24 10:33:45 org.apache.spark.util.Utils: Successfully started service 'driverPropsFetcher' on port 35455.
    WARN 2015-07-24 10:33:45 Remoting: Tried to associate with unreachable remote address [akka.tcp://sparkDriver@host032s4.staging.companynameremoved.info:50855]. Address is now gated for 60000 ms, all messages to this address will be delivered to dead letters.
    ERROR 2015-07-24 10:34:15 org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:skumar cause:java.util.concurrent.TimeoutException: Futures timed out after [30 seconds]
    

    我们要做的另一件事是在spark提交脚本中指定spark.driver.hostspark.driver.port属性.这是因为我们有两台IP地址的机器,并且FQDN解析为错误的IP地址.

    确保您的网络和DNS条目正确!

    2022-12-11 02:05 回答
  • 防火墙未配置,在某些情况下,它不允许从服务器连接到群集.这会生成超时问题,因为从站无法连接到服务器.如果您遇到此超时,请检查防火墙配置.

    2022-12-11 02:06 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有