EMR 上的 Spark 日志在哪里?

Where are the Spark logs on EMR?

EMRSpark 上的 运行 作业中,我无法找到来自 Scala 中 println 调用的错误日志或消息。

我在哪里可以访问这些?

我提交 Spark job,用 Scala 写到 EMR 使用 script-runner.jar 参数 --deploy-mode 设置为 cluster--master 设置为 yarn。它运行良好。

但是我没有在 Amazon EMR UI 中看到我的 println 语句,其中列出了“stderr, stdoutetc. Furthermore if my job errors I don't see why it had an error. All I see is this in thestderr`:

15/05/27 20:24:44 INFO yarn.Client: Application report from ResourceManager: 
 application identifier: application_1432754139536_0002
 appId: 2
 clientToAMToken: null
 appDiagnostics: 
 appMasterHost: ip-10-185-87-217.ec2.internal
 appQueue: default
 appMasterRpcPort: 0
 appStartTime: 1432758272973
 yarnAppState: FINISHED
 distributedFinalState: FAILED
 appTrackingUrl: http://10.150.67.62:9046/proxy/application_1432754139536_0002/A
 appUser: hadoop

`

如果您使用 emr-bootstrap 提交作业,您可以使用 --log-uri

将日志目录指定为 s3 存储桶

如果您通过 SSH 连接到集群的主节点,那么您应该能够在以下位置找到标准输出、标准错误、系统日志和控制器日志:

/mnt/var/log/hadoop/steps/<stepname>

使用 yarn 上的集群部署模式,Spark 驱动程序以及执行的用户代码将在 Application Master 容器中。听起来您在集群上启用了 EMR 调试,因此日志也应该推送到 S3。在 S3 位置查看 task-attempts/<applicationid>/<firstcontainer>/*

spark-history-server 所需的事件日志可在以下位置找到:

hdfs:///var/log/spark/apps

我也花了很多时间弄清楚这一点。在以下位置找到日志: EMR UI 控制台 -> 摘要 -> 日志 URI -> 容器 -> application_xxx_xxx -> container_yyy_yy_yy -> stdout.gz.