查看 application 某一个 container 的日志

yarn logs 参数如下:

Retrieve logs for completed YARN applications.
usage: yarn logs -applicationId <application ID> [OPTIONS]

general options are:
 -am <AM Containers>             Prints the AM Container logs for this
                                 application. Specify comma-separated
                                 value to get logs for related AM
                                 Container. For example, If we specify -am
                                 1,2, we will get the logs for the first
                                 AM Container as well as the second AM
                                 Container. To get logs for all AM
                                 Containers, use -am ALL. To get logs for
                                 the latest AM Container, use -am -1. By
                                 default, it will only print out syslog.
                                 Work with -logFiles to get other logs
 -appOwner <Application Owner>   AppOwner (assumed to be current user if
                                 not specified)
 -containerId <Container ID>     ContainerId. By default, it will only
                                 print syslog if the application is
                                 runing. Work with -logFiles to get other
                                 logs.
 -help                           Displays help for all commands.
 -logFiles <Log File Name>       Work with -am/-containerId and specify
                                 comma-separated value to get specified
                                 container log files. Use "ALL" to fetch
                                 all the log files for the container.
 -nodeAddress <Node Address>     NodeAddress in the format nodename:port

如果我们获取 hive 用户的 application_1635501674014_9264 的 am 的全部日志。

yarn logs -applicationId application_1635501674014_9264  \
  -containerId container_1635501674014_9264_01_000001  \
  -appOwner hive -nodeAddress ng5131090-core-instance-oa6q4tws-52.novalocal \
   > application_1635501674014_9264_am.log

默认是获取所有日志。可以获取某种日志,日志的种类有 directory.info、 launch_container.sh、stderr、stdout、syslog

如果获取 syslog 日志,可以加上 -logfiles 参数(发现 hadoop 2.7 根本没有解析这个参数)

yarn logs -applicationId application_1635501674014_9264  \
  -containerId container_1635501674014_9264_01_000001  \
  -appOwner hive -nodeAddress ng5131090-core-instance-oa6q4tws-52.novalocal \
  -logfiles syslog \
   > application_1635501674014_9264_am_syslog.log

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值