简体   繁体   English

如何尾纱原木?

[英]How to tail yarn logs?

I am submitting a Spark Job using below command.我正在使用以下命令提交 Spark 作业。 I want to tail the yarn log using application Id similar to tail command operation in Linux box.我想使用类似于 Linux 框中的尾部命令操作的应用程序 ID 来跟踪纱线日志。

export SPARK_MAJOR_VERSION=2
nohup spark-submit --class "com.test.TestApplication" --name TestApp --queue queue1 --properties-file application.properties --files "hive-site.xml,tez-site.xml,hbase-site.xml,application.properties" --master yarn --deploy-mode cluster Test-app.jar > /tmp/TestApp.log &

Not easily. 不容易。

"YARN logs" aren't really in YARN, they are actually on the executor nodes of Spark. “ YARN日志”并不是真正存在于YARN中,它们实际上位于Spark的执行程序节点上。 If YARN log aggregation is enabled, then logs are in HDFS, and available from Spark History server. 如果启用了YARN日志聚合,则日志位于HDFS中,并且可从Spark History服务器获取。

The industry deployment pattern is to configure the Spark log4j properties to write to a file with a log forwarder (like Filebeat, Splunk, Fluentd), then those processes collect data into a search engine like Solr, Elasticsearch, Graylog, Splunk, etc. From these tools, you can approximately tail/search/analyze log messages outside of a CLI. 行业部署模式是将Spark log4j属性配置为使用日志转发器(例如Filebeat,Splunk,Fluentd)写入文件,然后这些进程将数据收集到诸如Solr,Elasticsearch,Graylog,Splunk等的搜索引擎中。这些工具,您可以在CLI外部大约尾部/搜索/分析日志消息。

If by " Yarn logs " , you mean your executors' logs, you can see it easily or tail it if you have access to the executor machine where your yarn job is submitted. 如果用“纱线日志”表示您的执行者日志,则可以轻松查看该日志,如果可以访问提交纱线作业的执行者机器,则可以将其尾随。 You have to do just : 您只需要做:

yarn logs -applicationId <you app ID>

on the executor machine. 在执行程序机器上。 You can watch master logs in the yarn UI if you have configured it properly. 如果配置正确,则可以在yarn UI中观看主日志。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM