hive启动时有一堆WARN信息

发布时间 2023-12-02 23:19:34作者: 吾王_486

hive启动时有一堆WARN信息

比如:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = e43a63d5-0216-4f19-82c9-de01f792b868

Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-3.1.3.jar!/hive-log4j2.properties Async: true
23/12/02 22:52:54 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored
23/12/02 22:52:55 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:55 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:55 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:55 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:55 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:55 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:56 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:56 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:56 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:56 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:56 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
23/12/02 22:52:56 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Hive Session ID = da9496fe-1eec-4871-94aa-a6df0e7bf20a

在安装hive的conf目录下,新建log4j.properties日志的配置文件,添加以下内容

log4j.rootLogger=ERROR, CA           
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

重启hive即可

修改后:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = 652db4a7-476d-4419-9c08-74e27c3de83a

Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-3.1.3.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Hive Session ID = 24be6714-f296-4d69-9ad4-9072c097c89b