启动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:/usr/local/hive-0.10.0/lib/hive-common-0.10.0.jar!/hive-log4j.properties
解决方法:进入$HIVE_HOME/conf目录
cp hive-exec-log4j.properties.template hive-log4j.properties
sed -i '/log4j\.appender\.EventCounter/ s/org\.apache\.hadoop\.metrics\.jvm\.EventCounter/org\.apache\.hadoop.log\.metrics\.EventCounter/g' hive-log4j.properties
# 修改log4j.appender.EventCounter=org.apache.hadoop.metrics.jvm.EventCounter 为log4j.appender.EventCounter=org.apache.hadoop.log.metrics.EventCounter
然后重新运行hive,问题解决