hadoop 流:如何查看应用程序日志?

问题描述

我可以在我的 /usr/local/hadoop/logs 路径上看到所有 hadoop 日志

I can see all hadoop logs on my /usr/local/hadoop/logs path

但是我在哪里可以看到应用程序级别的日志?例如:

but where can I see application level logs? for example :

mapper.py

import logging

def main():
    logging.info("starting map task now")
    // -- do some task -- //
    print statement  

reducer.py

reducer.py

import logging
def main():
    for line in sys.stdin:
        logging.info("received input to reducer - " + line)  
        // -- do some task -- //
        print statement

在哪里可以看到 logging.info 或我的应用程序的相关日志语句?
我正在使用 Python 并使用 hadoop-streaming

Where I can see logging.info or related log statements of my application?
I am using Python and using hadoop-streaming

谢谢


解决方案

Hadoop流使用STDIN/STDOUT 用于在映射器和化简器之间传递键/值对,因此必须将日志消息写入特定的日志文件 - 检查 示例代码 和 python 日志记录文档 了解更多详情.这个查询也可能有帮助.

Hadoop streaming uses STDIN/STDOUT for passing the key/value pairs between the mappers and reducers, so the log messages have to be written to a specific log file - check the sample code and the python logging documentation for more details. This Query might also help.

相关文章