超时错误:错误状态代码为400:“要求失败:会话未激活。”

2024-05-29 08:05:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用Zeppelin v0.7.3笔记本来运行Pyspark脚本。在一个段落中,我运行脚本将数据从dataframe写入Blob文件夹中的parquet文件。文件按国家/地区分区。数据帧的行数是99,452,829。当脚本到达1 hour时,将遇到一个错误-

Error with 400 StatusCode: "requirement failed: Session isn't active.

笔记本的默认解释器是jdbc。我读过timeoutlifecyclemanager,并添加了解释器设置zeppelin.interpreter.lifecyclemanager.timeout.threshold,并将其设置为7200000,但在处理完成33%达到1小时运行时间后仍然遇到错误。在

我在1小时超时后检查了Blob文件夹,并成功地将parquet文件写入Blob,而Blob确实是按国家划分的。在

我运行的将DF写入parquet Blob的脚本如下:

trdpn_cntry_fct_denom_df.write.format("parquet").partitionBy("CNTRY_ID").mode("overwrite").save("wasbs://tradepanelpoc@blobasbackupx2066561.blob.core.windows.net/cbls/hdi/trdpn_cntry_fct_denom_df.parquet")

这是齐柏林飞艇超时问题吗?如何将其扩展到超过1小时的运行时间?谢谢你的帮助。在


Tags: 文件数据脚本文件夹错误时间笔记本国家
2条回答

来自This stack overflow question's answer which worked for me

从输出判断,如果你的应用程序没有以失败状态结束,这听起来像是Livy超时错误:你的应用程序很可能比Livy会话定义的超时时间长(默认为1h),所以即使Spark应用程序成功,如果应用程序花费的时间比Livy长,你的笔记本电脑也会收到这个错误会话超时。在

如果是这样的话,下面是如何解决的:

1. edit the /etc/livy/conf/livy.conf file (in the cluster's master node)
2. set the livy.server.session.timeout to a higher value, like 8h (or larger, depending on your app)
3. restart Livy to update the setting: sudo restart livy-server in the cluster's master
4. test your code again

timeout lifecycle manager从0.8版开始提供。在

Pypark似乎有问题。试试这个办法 Pyspark socket timeout exception after application running for a while

相关问题 更多 >

    热门问题