简体   繁体   English

EMR - Pyspark 错误 - 容器以非零退出代码 13 退出。错误文件:prelaunch.err

[英]EMR - Pyspark error -Container exited with a non-zero exit code 13. Error file: prelaunch.err

I am trying to execute a hello world like program in pyspark. I have created an EMR cluster thru boto3 and have added the step to execute my code.我正在尝试在 pyspark 中执行一个类似 hello world 的程序。我已经通过 boto3 创建了一个 EMR 集群,并添加了执行我的代码的步骤。

Step is:步骤是:

            'Name': 'Run Step',
            'ActionOnFailure': 'CONTINUE',
            'HadoopJarStep': {
                'Args': [
                    'spark-submit',
                    '--master', 'yarn',
                    '--deploy-mode', 'cluster',
                  #  '--py-files',
                    's3://bucket/s3csvload.py'
                ],
                'Jar': 'command-runner.jar'
            }
        }

The code I am trying to execute is我要执行的代码是

rom pyspark.sql import *
from pyspark.sql.types import *
from pyspark.sql.functions import *
from pyspark.sql import SparkSession

spark = SparkSession.builder.master('yarn').appName('DIF1').getOrCreate()

Input_schema1 = StructType([StructField("sepal_length", DecimalType(), True),
                            StructField("sepal_width", DecimalType(), True),
                            StructField("petal_length", DecimalType(), True),
                            StructField("petal_width", DecimalType(), True),
                            StructField("species", StringType(), True)])

lookup_df = spark.read \
              .option("header", "true") \
              .option("inferSchema", "true") \
              .option("schema", Input_schema1) \
              .csv("s3://bucket/iris.csv")

lookup_df.write.csv("s3://bucket/Target")

The error I am facing is:我面临的错误是:

20/12/22 15:27:29 INFO Client: 
     client token: N/A
     diagnostics: Application application_1xxxx0_0003 failed 2 times due to AM Container for appattempt_16xxxxx10_0003_000002 exited with  exitCode: 13
Failing this attempt.Diagnostics: [2020-12-22 15:27:28.643]Exception from container-launch.
Container id: container_16xxxx10_0003_02_000001
Exit code: 13

[2020-12-22 15:27:28.644]Container exited with a non-zero exit code 13. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :

I have tried related links.我试过相关链接。 Not much helpful.帮助不大。

I guess I have to change something in spark session builder.我想我必须更改 spark session builder 中的某些内容。 But, not sure.但是,不确定。 Any helps appreciated.任何帮助表示赞赏。 Thank you.谢谢你。

Following changes in my code solved the issue:以下更改我的代码解决了这个问题:

Steps=[
        {
            'Name': 'Run Step',
            'ActionOnFailure': 'CONTINUE',
            'HadoopJarStep': {
                'Jar': 'command-runner.jar',
                'Args': ['sudo',
                         'spark-submit',
                         '--master', 'yarn',
                         #        '--conf','spark.yarn.submit.waitAppCompletion=true'
                         '--deploy-mode', 'cluster',
                         '--py-files', 's3a://bucket/pgm.py', 's3a://bucket/pgm.py'
                         ]

            }
        }
    ]
spark = SparkSession.builder.appName('DIF1').getOrCreate()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 eslintrc.js:4 "parserOptions": { ^ SyntaxError: Unexpected token ':' functions predeploy error: 命令以非零退出代码 2 终止 - eslintrc.js:4 "parserOptions": { ^ SyntaxError: Unexpected token ':' functions predeploy error: Command terminated with non-zero exit code 2 Firebase 以非零退出代码(项目路径中的空格)开头的部署错误 - Firebase deploy errors starting with non-zero exit code (space in project path) 错误:运行时退出,出现错误:退出状态 129 - Error: Runtime exited with error: exit status 129 emr-container pyspark 作业无限期运行 - emr-container pyspark job running indefinitely 如何让 Simba ODBC 驱动程序从 Excel 运行 - 当前得到“意外错误:容器意外退出,代码为 0x40000015。” 错误 - How do I get the Simba ODBC driver to run from Excel - Currently get "Unexpected error: Container exited unexpectedly with code 0x40000015.' eror AWS GlueJob 错误 - 命令失败,退出代码为 137 - AWS GlueJob Error - Command failed with exit code 137 完成错误:Gradle 任务 assembleDebug 失败,退出代码为 1 - Finished with error: Gradle task assembleDebug failed with exit code 1 引导操作后 EMR 上的导入错误 - Import error on EMR after bootstrap action 创建EMR集群出错,EMR服务角色无效 - Error when creating EMR cluster, EMR service role is invalid 执行命令时出错:sam build --use-container --template ${SAM_TEMPLATE}。 原因:退出状态1 - Error while executing command: sam build --use-container --template ${SAM_TEMPLATE}. Reason: exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM