Hive学习笔记(3)- Hive 运行日志的配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u012292754/article/details/86508884

1 Hive 运行日志配置

[hadoop@node1 ~]$ cd $HIVE_HOME/conf
[hadoop@node1 conf]$ ll
total 20
-rw-r--r--. 1 hadoop hadoop 1196 Mar 24  2016 beeline-log4j.properties.template
-rw-r--r--. 1 hadoop hadoop 2470 Jan 16 12:36 hive-env.sh
-rw-r--r--. 1 hadoop hadoop 2662 Mar 24  2016 hive-exec-log4j.properties.template
-rw-r--r--. 1 hadoop hadoop 3505 Mar 24  2016 hive-log4j.properties.template
-rw-rw-r--. 1 hadoop hadoop  938 Jan 16 15:36 hive-site.xml
[hadoop@node1 conf]$ cp hive-log4j.properties.template hive-log4j.properties

  • hive-log4j.properties
hive.log.dir=/home/hadoop/appsData/hivelogs

2 Hive 属性配置

hive > set
...........
system:sun.java.launcher=SUN_STANDARD
system:sun.jnu.encoding=UTF-8
system:sun.management.compiler=HotSpot 64-Bit Tiered Compilers
system:sun.os.patch.level=unknown
system:user.country=US
system:user.dir=/home/hadoop
system:user.home=/home/hadoop
system:user.language=en
system:user.name=hadoop
system:user.timezone=Asia/Shanghai

3 Hive 常见属性配置

3.1 Hive 数据仓库的位置

  • default : /user/hive/warehouse
- 在仓库目录下,没有对默认的数据库 default 创建文件夹
- 如果某张表属于 default 数据库,直接在数据仓库目录下创建一个文件夹

3.2 Hive 运行日志信息

  • hive-log4j.properties

3.3 在 CLI 命令行上显示当前数据库,以及查询表的信息

  • hive-site.xml
<property>
	<name>hive.cli.print.header</name>
	<value>true</value>
</property>

<property>
	<name>hive.cli.print.current.db</name>
	<value>true</value>
</property>

3.4 hive 启动时参数的设置

hive -help
[hadoop@node1 ~]$ hive -help
ls: cannot access /home/hadoop/apps/spark-2.2.2-bin-2.6.0-cdh5.7.0/lib/spark-assembly-*.jar: No such file or directory
2019-01-16 16:19:46,599 WARN  [main] mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present.  Continuing without it.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/apps/hbase-1.2.0-cdh5.7.0/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/apps/hadoop-2.6.0-cdh5.7.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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.slf4j.impl.Log4jLoggerFactory]
2019-01-16 16:19:46,696 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
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
    --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
 -S,--silent                      Silent mode in interactive shell
 -v,--verbose                     Verbose mode (echo executed SQL to the
                                  console)
[hadoop@node1 ~]$ 

3.5 查看当前所有的配置信息

hive> set

猜你喜欢

转载自blog.csdn.net/u012292754/article/details/86508884