Hive的日志操作
想要看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的日志操作的更多相关文章
- 基于hive的日志分析系统
转自 http://www.cppblog.com/koson/archive/2010/07/19/120773.html hive 简介 hive 是一个基于 ...
- Hive配置与操作实践
Hive配置与操作实践 @(Hadoop) 安装hive hive的安装十分简单,只需要在一台服务器上部署即可. 上传hive安装包,解压缩,将其配入环境变量. mysql的设置 在要作为元数据库的m ...
- mysql 查看 删除 日志操作总结(包括单独和主从mysql)
我们可以在mysql的安装目录下看到mysql的二进制日志文件,如mysql-bin.000***等,很多人都不及时的处理,导致整个硬盘被塞满也是有可能的.这些是数据库的操作日志.它记录了我们平时使用 ...
- SQL Server 最小化日志操作解析,应用
Sql Server 中数据库在BULK_LOGGED/SIMPLE模式下的一些操作会采用最小化日志的记录方式,以减小tran log落盘日志量从而提高整体性能. 这里我简单介绍下哪些操作在什么样的情 ...
- 使用Log4j进行日志操作
使用Log4j进行日志操作 一.Log4j简介 (1)概述 Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件.甚至是套接字服 ...
- SQL Server 最小化日志操作解析,应用[手稿]
Sql Server 中数据库在BULK_LOGGED/SIMPLE模式下的一些操作会采用最小化日志的记录方式,以减小tran log落盘日志量从而提高整体性能. 这里我简单介绍下哪些操作在什么样的情 ...
- xBIM 日志操作
目录 xBIM 应用与学习 (一) xBIM 应用与学习 (二) xBIM 基本的模型操作 xBIM 日志操作 XBIM 3D 墙壁案例 xBIM 格式之间转换 xBIM 使用Linq 来优化查询 x ...
- python中的日志操作和发送邮件
1.python中的日志操作 安装log模块:pip install nnlog 参数:my_log = nnlog.Logger('server_log.log',level='debug',bac ...
- 如何监听对 HIVE 元数据的操作
目录 简介 HIVE 基本操作 获取 HIVE 源码 编译 HIVE 源码 启动 HIVE 停止 HIVE 监听对 HIVE 元数据的操作 参考文档 简介 公司有个元数据管理平台,会定期同步 HIVE ...
随机推荐
- pipreqs------查找python项目依赖并生成requirement
一起开发项目的时候总是要搭建环境和部署环境的,这个时候必须得有个python第三方包的list,一般都叫做requirements.txt. 如果一个项目使用时virtualenv环境,还好办 pip ...
- JDK1.8为什么废弃永久代【一篇就够】[z]
https://blog.csdn.net/sjmz30071360/article/details/89456177 (Metaspace) 1.背景 2.为什么废弃永久代(PermGen) 3.深 ...
- flutter 安卓再次点击返回退出应用
安卓手机点击实体或者虚拟返回键,会返回上一级,当到达最上层是,点击返回退出应用,为了防止用户连续点击返回,导致应用退出,在用户点击返回到最上层时,如果再次点击返回,第一次不退出,并提升用户再次点击退出 ...
- 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-7.接口配置文件自动映射到属性和实体类配置
笔记 7.接口配置文件自动映射到属性和实体类配置 简介:使用@value注解配置文件自动映射到属性和实体类 1.添加 @Component或者Configuration 注解: ...
- TextInput组件的常用属性
1.TextInput组件基本介绍: TextInput是一个允许用户在应用中通过键盘输入文本的基本组件.本组件的属性提供了多种特性的配置,譬如自动完成.自动大小写.占位文字,以及多种不同的键盘类型( ...
- 用事件队列来处理pixi中的场景元素入场
在pixi中,添加一个精灵元素,你可能需要,先将贴图load进来,然后才能添加到场景中去,所以一般会这么操作 Loader.add("tree","static/imag ...
- CWinThread类,使用后要不要使用CloseHandle释放内核
在VC++中用AfxBeginThread()开启线程的时候,返回的是CWinThead类的指针.但是使用后是否应该用CloseHandle释放内核资源呢? 在<Windows核心编程>中 ...
- Pulse Secure 任意文件读取(CVE-2019-11510)漏洞
漏洞分析 我们可以通过CVE-2019-11510这个未授权的任意文件读取漏洞把以下文件下载回来. /etc/passwd /etc/hosts /data/runtime/mtmp/system / ...
- 李宏毅 线性回归预测PM2.5
作业说明 给定训练集train.csv,要求根据前9个小时的空气监测情况预测第10个小时的PM2.5含量. 训练集介绍: (1):CSV文件,包含台湾丰原地区240天的气象观测资料(取每个月前20天的 ...
- 面试总结 | 百度 NLP 实习生
1. 项目简历:主要体现和招聘要求相关的工作,简历要精简,不要给过多冗余信息.对于每个项目,自己做过的工作,里面用到的方法,要很清楚,工作的motivation.意义等也要清楚. 这次面试中我的问题: ...