java - DataProc 上 Spark/Hive 中的意外日志条目
问题描述
我正在 DataProc 中运行火花作业。我正在使用工作中的 Hive 连接。
为了我自己的需要,我想以 JSON 格式输出所有日志,并且在当前测试中我配置/etc/spark/conf/log4j.properties
了:
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.hadoop.log.Log4Json
这会以 JSON 格式输出 Spark 日志。
现在我在输出中看到了一些奇怪的行:
...
ivysettings.xml file not found in HIVE_HOME or HIVE_CONF_DIR,/etc/hive/conf.dist/ivysettings.xml will be used
{"name":"DependencyResolver","time":1618431755337,"date":"2021-04-14 20:22:35,337","level":"INFO","thread":"nioEventLoopGroup-2-2","message":"ivysettings.xml file not found in HIVE_HOME or HIVE_CONF_DIR,/etc/hive/conf.dist/ivysettings.xml will be used"}
我的假设是非 JSON 行是 Hive 日志输出,实现为:
// If HIVE_HOME is not defined or file is not found in HIVE_HOME/conf then load default ivysettings.xml from class loader
if (ivysettingsPath == null || !(new File(ivysettingsPath).exists())) {
ivysettingsPath = ClassLoader.getSystemResource("ivysettings.xml").getFile();
_console.printInfo("ivysettings.xml file not found in HIVE_HOME or HIVE_CONF_DIR," + ivysettingsPath + " will be used");
}
问题是我看不到此输出的配置位置。我找到了2个文件:
- /etc/hive/conf/hive-log4j2.properties
- /etc/hive/conf/hive-exec-log4j2.properties
并且其中没有一个包含 INFO 输出的配置。
有没有办法以某种集中的方式配置 spark/hadoop/hive 或实现统一的日志记录?
解决方案
推荐阅读
- android - Android浏览器在浏览器未打开时推送通知
- django - 从 django rest 框架序列化程序中的数组中删除键
- javascript - 如何捕获 HTML 5 视频元素下载事件
- python - 将python中的列表分成元组
- wix - 使用 Wix 将整个目录添加到 MSI 数据库的规范方法是什么?
- docker - 码头工人。无法执行从主机复制到映像的文件
- java - 在 bitbucket api 方法中从 InputStream 中读取内容
- javascript - 你如何在javascript中通过其内部文本单击按钮?
- sql - Oracle:如何计算两个日期之间数据库中的插入次数
- sapui5 - 格式化程序传递静态值