想要看hive的日志,我们查看/home/hadoop/hive/conf/hive-log4j2.properties

# list of properties
property.hive.log.level = INFO
property.hive.root.logger = DRFA
property.hive.log.dir = ${sys:java.io.tmpdir}/${sys:user.name}
property.hive.log.file = hive.log
property.hive.perflogger.log.level = INFO

红色部分说明了hive的日志目录,但是我们查看 echo ${sys:java.io.tmpdir} 是没有输出的,为空,其实日志目录在系统的/tmp/hostname/hive.log

[hadoop@master hadoop]$ pwd
/tmp/hadoop
[hadoop@master hadoop]$ ls -rlt
total
-rw-rw-r--. hadoop hadoop Jan : hive.log.--
-rw-rw-r--. hadoop hadoop Mar : hive.log.--
-rw-rw-r--. hadoop hadoop Apr : hive.log.--
-rw-rw-r--. hadoop hadoop Apr : stderr
-rw-rw-r--. hadoop hadoop Apr : hive.log

在hive的安装目录,新建一个logs目录,来存储日志文件

[hadoop@master hive]$ pwd
/home/hadoop/hive
[hadoop@master hive]$ mkdir logs

修改配置文件 hive-log4j2.properties

property.hive.log.dir = /home/hadoop/hive/logs

退出hive

[hadoop@master sbin]$ hive

Logging initialized using configuration in file:/home/hadoop/hive/conf/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive .X releases.
hive> show databases;
OK
db_hive
default
Time taken: 3.857 seconds, Fetched: row(s)
hive> use db_hive;
OK
Time taken: 0.024 seconds
hive> exit ;

重新启动hive

[hadoop@master logs]$ pwd
/home/hadoop/hive/logs
[hadoop@master logs]$ ls -rlt
total
-rw-rw-r--. hadoop hadoop Apr : hive.log

可以看到hive的日志已经更改路径了

可以看hive中的变量:

hive> set;

...
...
system:sun.java.launcher=SUN_STANDARD
system:sun.jnu.encoding=UTF-
system:sun.management.compiler=HotSpot -Bit Tiered Compilers
system:sun.os.patch.level=unknown
system:user.country=US
system:user.dir=/home/hadoop/hadoop-2.7./sbin
system:user.home=/home/hadoop
system:user.language=en
system:user.name=hadoop
system:user.timezone=America/Los_Angeles

设置属性在启动的时候

[hadoop@master sbin]$ hive -help
usage: hive
-d,--define <key=value> Variable substitution 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 substitution 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@master sbin]$ hive --hiveconf hive.root.logger=INFO,console Logging initialized using configuration in file:/home/hadoop/hive/conf/hive-log4j2.properties Async: true
--02T22::, INFO [main] SessionState:
Logging initialized using configuration in file:/home/hadoop/hive/conf/hive-log4j2.properties Async: true
--02T22::, WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Hive-on-MR is deprecated in Hive and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive .X releases.
hive> use db_hive;
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Compiling command(queryId=hadoop_20190402225652_7939edc0-f75c--8bc3-a2b793b0251f): use db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : Opening raw store with implementation class:org.apache.hadoop.hive.metastore.ObjectStore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.ObjectStore: ObjectStore, initialize called
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.ObjectStore: Initialized ObjectStore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: Added admin role in metastore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: Added public role in metastore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: No user is added in admin role, since config is empty
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_all_functions
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_all_functions
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Semantic Analysis Completed
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Returning Hive schema: Schema(fieldSchemas:null, properties:null)
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Completed compiling command(queryId=hadoop_20190402225652_7939edc0-f75c--8bc3-a2b793b0251f); Time taken: 3.036 seconds
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Concurrency mode is disabled, not creating a lock manager
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Executing command(queryId=hadoop_20190402225652_7939edc0-f75c--8bc3-a2b793b0251f): use db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] sqlstd.SQLStdHiveAccessController: Created SQLStdHiveAccessController for session context : HiveAuthzSessionContext [sessionString=ad332b5e-6ec9--bef1-253a5ab59e59, clientType=HIVECLI]
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] hive.metastore: Mestastore configuration hive.metastore.filter.hook changed from org.apache.hadoop.hive.metastore.DefaultMetaStoreFilterHookImpl to org.apache.hadoop.hive.ql.security.authorization.plugin.AuthorizationMetaStoreFilterHook
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : Cleaning up thread local RawStore...
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=Cleaning up thread local RawStore...
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : Done cleaning up thread local RawStore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=Done cleaning up thread local RawStore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Starting task [Stage-:DDL] in serial mode
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : Opening raw store with implementation class:org.apache.hadoop.hive.metastore.ObjectStore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.ObjectStore: ObjectStore, initialize called
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.ObjectStore: Initialized ObjectStore
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Completed executing command(queryId=hadoop_20190402225652_7939edc0-f75c--8bc3-a2b793b0251f); Time taken: 0.175 seconds
OK
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: OK
Time taken: 3.222 seconds
hive> show tables;
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Compiling command(queryId=hadoop_20190402225706_0f585a6e-ca17--8d99-3260e7caabf5): show tables
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Semantic Analysis Completed
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] exec.ListSinkOperator: Initializing operator LIST_SINK[]
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Completed compiling command(queryId=hadoop_20190402225706_0f585a6e-ca17--8d99-3260e7caabf5); Time taken: 0.076 seconds
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Concurrency mode is disabled, not creating a lock manager
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Executing command(queryId=hadoop_20190402225706_0f585a6e-ca17--8d99-3260e7caabf5): show tables
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Starting task [Stage-:DDL] in serial mode
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_database: db_hive
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] metastore.HiveMetaStore: : get_tables: db=db_hive pat=.*
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] HiveMetaStore.audit: ugi=hadoop ip=unknown-ip-addr cmd=get_tables: db=db_hive pat=.*
OK
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: Completed executing command(queryId=hadoop_20190402225706_0f585a6e-ca17--8d99-3260e7caabf5); Time taken: 0.028 seconds
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] ql.Driver: OK
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] mapred.FileInputFormat: Total input paths to process :
--02T22::, INFO [ad332b5e-6ec9--bef1-253a5ab59e59 main] exec.ListSinkOperator: Closing operator LIST_SINK[]
u2
u4
Time taken: 0.105 seconds, Fetched: row(s)

日志比较详细。

Hive的日志操作的更多相关文章

  1. 基于hive的日志分析系统

    转自 http://www.cppblog.com/koson/archive/2010/07/19/120773.html           hive 简介         hive 是一个基于  ...

  2. Hive配置与操作实践

    Hive配置与操作实践 @(Hadoop) 安装hive hive的安装十分简单,只需要在一台服务器上部署即可. 上传hive安装包,解压缩,将其配入环境变量. mysql的设置 在要作为元数据库的m ...

  3. mysql 查看 删除 日志操作总结(包括单独和主从mysql)

    我们可以在mysql的安装目录下看到mysql的二进制日志文件,如mysql-bin.000***等,很多人都不及时的处理,导致整个硬盘被塞满也是有可能的.这些是数据库的操作日志.它记录了我们平时使用 ...

  4. SQL Server 最小化日志操作解析,应用

    Sql Server 中数据库在BULK_LOGGED/SIMPLE模式下的一些操作会采用最小化日志的记录方式,以减小tran log落盘日志量从而提高整体性能. 这里我简单介绍下哪些操作在什么样的情 ...

  5. 使用Log4j进行日志操作

    使用Log4j进行日志操作 一.Log4j简介 (1)概述 Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件.甚至是套接字服 ...

  6. SQL Server 最小化日志操作解析,应用[手稿]

    Sql Server 中数据库在BULK_LOGGED/SIMPLE模式下的一些操作会采用最小化日志的记录方式,以减小tran log落盘日志量从而提高整体性能. 这里我简单介绍下哪些操作在什么样的情 ...

  7. xBIM 日志操作

    目录 xBIM 应用与学习 (一) xBIM 应用与学习 (二) xBIM 基本的模型操作 xBIM 日志操作 XBIM 3D 墙壁案例 xBIM 格式之间转换 xBIM 使用Linq 来优化查询 x ...

  8. python中的日志操作和发送邮件

    1.python中的日志操作 安装log模块:pip install nnlog 参数:my_log = nnlog.Logger('server_log.log',level='debug',bac ...

  9. 如何监听对 HIVE 元数据的操作

    目录 简介 HIVE 基本操作 获取 HIVE 源码 编译 HIVE 源码 启动 HIVE 停止 HIVE 监听对 HIVE 元数据的操作 参考文档 简介 公司有个元数据管理平台,会定期同步 HIVE ...

随机推荐

  1. ansible简单入门

    1,结构框架 Ansible 使用的是无代理体系结构,这种体系结构可以通过防止节点轮询控制机器来减少网络开销.Ansible 提供的结果框架如下所示: Ansible :运行在中央计算机上: Conn ...

  2. Qt编写自定义控件14-环形进度条

    前言 环形进度条,用来展示当前进度,为了满足大屏UI的需要特意定制,以前有个叫圆环进度条,不能满足项目需要,只能重新定做,以前的进度间距不能自适应分辨率,而且当前进度对应的反的进度不能单独设置颜色,即 ...

  3. Linux命令行如何返回上一次的目录

    千辛万苦进入了一个很深层的目录,一不小心输入了cd并回车 ......... 并不是再进一次,对于bash来说,只需要很管理的一个命令: cd - 该命令等同于cd $OLDPWD,关于这一点在bas ...

  4. Kafka管理与监控——调优

    1.JVM参数配置优化 如果使用的CMS GC算法,建议JVM Heap不要太大,在4GB以内就可以.JVM太大,导致Major GC或者Full GC产生的“stop the world”时间过长, ...

  5. Windows命令行工具cmder配置

    简介 cmder是一个增强型命令行工具,不仅可以使用windows下的所有命令,更爽的是可以使用linux的命令,shell命令. 下载 官网地址:http://cmder.net/ 下载的时候,会有 ...

  6. 【网易微专业】图表绘制工具Matplotlib

    01 与图片的交互方式设置 这一小节简要介绍一下Matplotlib的交互方式 import pandas as pd import numpy as np import matplotlib.pyp ...

  7. 架构模式: 健康检查API

    架构模式: 健康检查API 上下文 您已应用微服务架构模式.有时,服务实例可能无法处理仍在运行的请求.例如,它可能已用完数据库连接.发生这种情况时,监控系统应生成警报.此外,负载平衡器或服务注册表不应 ...

  8. 安装 maven

    1.打开http://maven.apache.org/index.html 2.选择USE,点击下载 3.下移窗口到File点击红框内的链接 4.将下载的压缩包解压到c:\apps 5.将maven ...

  9. HDU 1688 Sightseeing 【输出最短路+次短路条数】

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1688 题目大意:给n个点,m条有向边.再给出起点s, 终点t.求出s到t的最短路条数+次短路条数. 思 ...

  10. 并发-synchronized

    线程并发-synchronized和Lock简单认知 前几天刚加深了线程的了解,期间在验证各种方法及多线程时遇到一些疑问,在高并发的情况下,怎么做才能保证程序还能按照我们预期的正常运行下去,这就是我们 ...