我正在运行 Pyspark 脚本以将数据帧写入 jupyter Notebook 中的 csv,如下所示:
df.coalesce(1).write.csv('Data1.csv',header = 'true')
Run Code Online (Sandbox Code Playgroud)
运行一个小时后,我收到以下错误。
错误:来自http://.....session 的无效状态代码未激活。
我的配置是这样的:
spark.conf.set("spark.dynamicAllocation.enabled","true")
spark.conf.set("shuffle.service.enabled","true")
spark.conf.set("spark.dynamicAllocation.minExecutors",6)
spark.conf.set("spark.executor.heartbeatInterval","3600s")
spark.conf.set("spark.cores.max", "4")
spark.conf.set("spark.sql.tungsten.enabled", "true")
spark.conf.set("spark.eventLog.enabled", "true")
spark.conf.set("spark.app.id", "Logs")
spark.conf.set("spark.io.compression.codec", "snappy")
spark.conf.set("spark.rdd.compress", "true")
spark.conf.set("spark.executor.instances", "6")
spark.conf.set("spark.executor.memory", '20g')
spark.conf.set("hive.exec.dynamic.partition", "true")
spark.conf.set("hive.exec.dynamic.partition.mode", "nonstrict")
spark.conf.set("spark.driver.allowMultipleContexts", "true")
spark.conf.set("spark.master", "yarn")
spark.conf.set("spark.driver.memory", "20G")
spark.conf.set("spark.executor.instances", "32")
spark.conf.set("spark.executor.memory", "32G")
spark.conf.set("spark.driver.maxResultSize", "40G")
spark.conf.set("spark.executor.cores", "5")
Run Code Online (Sandbox Code Playgroud)
我检查了容器节点,错误是:
ExecutorLostFailure (executor 2 exited caused by one of the running tasks) Reason: Container marked as failed:container_e836_1556653519610_3661867_01_000005 on host: ylpd1205.kmdc.att.com. Exit status: 143. Diagnostics: Container killed …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用spark-submit运行本地jar文件,效果很好。这是命令-
spark-submit --class "SimpleApp" --master local myProject/target/scala-2.11/simple-project_2.11-1.0.jar
Run Code Online (Sandbox Code Playgroud)
但是当我尝试卷曲时
curl -X POST --data '{
"file": "file:///home/user/myProject/target/scala-2.11/simple-project_2.11-1.0.jar",
"className": "SimpleApp",
}'
-H
"Content-Type: application/json"
http://server:8998/batches
Run Code Online (Sandbox Code Playgroud)
它抛出错误
"requirement failed: Local path /home/user/myProject/target/scala-2.11/simple-project_2.11-1.0.jar cannot be added to user sessions."
Run Code Online (Sandbox Code Playgroud)
这是我的livy.conf文件,因为有些文章建议更改一些内容。
# What host address to start the server on. By default, Livy will bind to all network interfaces.
livy.server.host = 0.0.0.0
# What port to start the server on.
livy.server.port = 8998
# What spark master Livy sessions should use.
livy.spark.master = local
# What …Run Code Online (Sandbox Code Playgroud) 我正在创建一个EMR集群,并使用jupyter Notebook运行一些Spark任务。我的任务在执行大约1小时后死亡,错误是:
An error was encountered:
Invalid status code '400' from https://xxx.xx.x.xxx:18888/sessions/0/statements/20 with error payload: "requirement failed: Session isn't active."
Run Code Online (Sandbox Code Playgroud)
我的理解是,它与Livy配置有关livy.server.session.timeout,但是我不知道如何在集群的引导程序中进行设置(我需要在引导程序中进行设置,因为创建的集群没有ssh访问权限)
提前谢谢
我只想显示该列而不会截断成一个选择,在这里我有一个数组或一个长度很大的Map。
我使用齐柏林飞艇来查询df寄存器作为临时表:
%livy.sql
select * from maTable
Run Code Online (Sandbox Code Playgroud)
你有什么主意吗?
我正在使用 Apache Livy 批量 POST 方法提交 Spark 作业。
此 HTTP 请求是使用 AirFlow 发送的。提交作业后,我正在使用批次 ID 跟踪状态。
我想在 Air Flow 日志上显示驱动程序(客户端日志)日志,以避免转到多个位置 AirFlow 和 Apache Livy/Resource Manager。
使用 Apache Livy REST API 是否可以做到这一点?
我有一个进程(在scala中)在spark集群中运行,它处理一些数据,上传结果并更新处理状态。我希望上传和处理状态更新是原子操作,因为状态对于恢复作业和避免双重处理至关重要。每当我们想要更新 jar 时,就需要定期终止正在运行的作业并启动一个新作业。在终止作业时,我想处理原子操作并在上传之前优雅退出或等到上传和处理状态更新完成。如何才能达到同样的效果呢?如果我们使用纱线 API 来终止应用程序,它可能会突然从不一致的状态退出。解决这个问题的最佳方法是什么?
我正在使用 livy-server-0.2 来运行 spark 作业,但是,我无法更改 spark.executor.cores 的默认设置,它无法生效,而其他设置可以。
它总是使用 1 个核心来启动一个执行程序。
yarn 11893 11889 6 21:08 ? 00:00:01
/opt/jdk1.7.0_80/bin/java -server -XX:OnOutOfMemoryError=kill
%p -Xms1024m -Xmx1024m -Djava.io.tmpdir=/var/lib/hadoop-yarn/cache/yarn/nm-local-dir/usercache/root/appcache/application_1487813931557_0603/container_1487813931557_0603_01_000026/tmp
-Dspark.driver.port=51553
-Dspark.yarn.app.container.log.dir=/var/log/hadoop-yarn/containers/application_1487813931557_0603/container_1487813931557_0603_01_000026
-XX:MaxPermSize=256m org.apache.spark.executor.CoarseGrainedExecutorBackend
--driver-url spark://CoarseGrainedScheduler@10.1.1.81:51553 --executor-id 19
--hostname master01.yscredit.com --cores 1 --app-id application_1487813931557_0603
--user-class-path file:/var/lib/hadoop-yarn/cache/yarn/nm-local-dir/usercache/root/appcache/application_1487813931557_0603/container_1487813931557_0603_01_000026/__app__.jar
Run Code Online (Sandbox Code Playgroud)
这是我在 $SPARK_HOME/conf 中的 spark-defaults.conf 文件
spark.master=yarn
spark.submit.deployMode=cluster
spark.executor.instances=7
spark.executor.cores=6
spark.executor.memoryOverhead=1024
spark.yarn.executor.memoryOverhead=1400
spark.executor.memory=11264
spark.driver.memory=5g
spark.yarn.driver.memoryOverhead=600
spark.speculation=true
spark.yarn.executor.memoryOverhead=1400
Run Code Online (Sandbox Code Playgroud)
有谁能够帮助我?谢谢!
livy ×7
apache-spark ×6
scala ×2
airflow ×1
amazon-emr ×1
core ×1
executor ×1
hadoop-yarn ×1
pyspark ×1
rdd ×1
sql ×1