Hive警告的解决办法 WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated

[hadoop@master data]$ hive
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/app/hive/lib/hive-common-0.9.0.jar!/hive-log4j.properties

Hive history file=/tmp/hadoop/hive_job_log_hadoop_201209251016_560764333.txt


当登录hive的时候 老是有个警告:

WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.

根据警告的提示 只需要将 一个参数值从 org.apache.hadoop.metrics.jvm.EventCounter 修改为 org.apache.hadoop.log.metrics.EventCounter 即可。


解决的办法:

-- 将conf下面所有的配置文件都cp 一份

cd $HIVE_HOME/conf

cp hive-default.xml.template hive-default.xml

cp hive-default.xml.template hive-site.xml

cp hive-env.sh.template hive-env.sh

cp hive-log4j.properties.template hive-log4j.properties

--修改参数

vi hive-log4j.properties

找到 参数项 log4j.appender.EventCounter

将这一项的值修改为: org.apache.hadoop.log.metrics.EventCounter



修改之后就好了 再次登录hive 警告就消失了。

[hadoop@master conf]$ hive Logging initialized using configuration in file:/app/hive/conf/hive-log4j.properties Hive history file=/tmp/hadoop/hive_job_log_hadoop_201209251022_944441939.txt hive> exit;