1.8 Hive運行日志配置和查看


一、配置文件

1、重命名配置文件

#
把/opt/modules/hive-0.13.1/conf/hive-log4j.properties.template重命名為hive-log4j.properties

#重新進入hive
[root@hadoop-senior hive-0.13.1]# bin/hive
Logging initialized using configuration in file:/opt/modules/hive-0.13.1/conf/hive-log4j.properties    #此時加載的配置文件就是重命名后的
hive (default)>

2、配置log目錄

#創建log目錄
[root@hadoop-senior hive-0.13.1]# pwd
/opt/modules/hive-0.13.1

[root@hadoop-senior hive-0.13.1]# mkdir logs


#配置進文件
hive.log.dir=/opt/modules/hive-0.13.1/logs    #找到此行,改為這樣


#此時重新進入一下hive,log文件就生成了
[root@hadoop-senior logs]# ls
hive.log

2、命令行設置

#進入hive的命令行其實也可以設置很多值;
#直接打如下命令,就會顯示很多當前設置的值;
hive (default)> set;


#bin/hive命令
直接用bin/hive命令也可以設置值;
[root@hadoop-senior hive-0.13.1]# bin/hive -h    #看幫助
Missing argument for option: h
usage: hive
 -d,--define <key=value>          Variable subsitution to apply to hive
                                  commands. e.g. -d A=B or --define A=B
    --database <databasename>     Specify the database to use
 -e <quoted-query-string>         SQL from command line
 -f <filename>                    SQL from files
 -H,--help                        Print help information
 -h <hostname>                    connecting to Hive Server on remote host
    --hiveconf <property=value>   Use value for given property
    --hivevar <key=value>         Variable subsitution to apply to hive
                                  commands. e.g. --hivevar A=B
 -i <filename>                    Initialization SQL file
 -p <port>                        connecting to Hive Server on port number
 -S,--silent                      Silent mode in interactive shell
 -v,--verbose                     Verbose mode (echo executed SQL to the
                                  console)


#使用
[root@hadoop-senior hive-0.13.1]# bin/hive --hiveconf hive.root.logger=INFO,console    #設置日志級別,console;讓日志可以顯示在命令行(詳細的)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM