想要看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. 06 MySQL之索引

    01-索引 1.索引是对数据库表中一列或多列的值进行排序的一种数据结构,使用索引可提高数据库中特定数据的查询速度. 2.索引是一个单独的.存储在磁盘上的数据库结构,包含对数据表里所有记录的引用指针. ...

  2. NLP之电影评分数据的情感分析

    1.基于词袋模型的逻辑回归情感分类 # coding: utf-8 import re import numpy as np import pandas as pd from bs4 import B ...

  3. Mac 配置flutter

    1. vim ~/.base_profile 2. 如下 export PATH=/Users/korea/Desktop/development/flutter/bin:$PATH export P ...

  4. Docker部署Nextcloud私有网盘

    对于国内某度的网盘限速行为大家有目共睹,不过对于商业化的产品模式这样也无可厚非,毕竟企业也是盈利为目的.如果想享受互联网技术带来的便利,刚好也懂一点技术的话可以尝试搭建属于私有的网盘.个人比较推荐的是 ...

  5. APP安全_Android反编译

    反编译 Android的反编译工具:apktool,JEB等. Apk 文件的结构,如下: META-INF:签名文件 res:资源文件,里面的 xml 格式文件在编译过程中由文本格式转化为二进制的 ...

  6. Python 筛选前缀文件

    筛选某一文件下内具备某一前缀的文件: for file in files filename = os.path.listdir(file) if 'qianzhui--' in filename: # ...

  7. 上传本地文件到SVN

    前言:今天按照自己的记忆上传本地文件夹到SVN,出现了点问题,重温了简单操作. https://blog.csdn.net/qq_35150366/article/details/81129847 参 ...

  8. 随笔--第一次使用crontab linux选择编辑器问题

    第一次使用crontab 时,会出现:no crontab for root - using an empty one “Select a editor ......”下面有几个选项,就是叫你选择编辑 ...

  9. Linux正则表达式题型

    1.将下面的/etc/passwd所有行的第一列和最后一列相互调换位置. 解答: 1)使用sed的后向引用 2)awk -F ":" '{print $7":" ...

  10. PAT B1036 跟奥巴马一起编程 (15)

    AC代码 #include <cstdio> using namespace std; int main(){ int n = 0, m = 0; char a; scanf(" ...