hadoop Streaming:如何查看应用程序日志?
我可以在 /usr/local/hadoop/logs
路径上查看所有 hadoop 日志
,但在哪里可以查看应用程序级别日志?例如:
mapper.py
import logging
def main():
logging.info("starting map task now")
// -- do some task -- //
print statement
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
谢谢
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
import logging
def main():
for line in sys.stdin:
logging.info("received input to reducer - " + line)
// -- do some task -- //
print statement
Where I can see logging.info
or related log statements of my application?
I am using Python
and using hadoop-streaming
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Hadoop 收集 stderr,可以在 hadoop map/reduce 状态站点上查看。所以你可以直接写到stderr。
Hadoop gathers stderr, which can be viewed on hadoop map/reduce status site. So you can just write to stderr.
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.