hive 补0_Hive补充

Hive补充

1.认知

1.Mapreduce的客户端,避免写繁琐的MapReduce程序;

2.metastore:原本的数据集和字段名称以及数据信息之间双射关系;

3.Server-Hadoop;在操作Hive同时,需要将Hadoop的HDFS,YARN开启,MAPRED配置好.

2.本地避免使用MapReduce

设置:

hive.fetch.task.conversion

more

Some select queries can be converted to single FETCH task minimizing latency.

Currently the query should be single sourced not having any subquery and should not have

any aggregations or distincts (which incurs RS), lateral views and joins.

1. minimal : SELECT STAR, FILTER on partition columns, LIMIT only

2. more : SELECT, FILTER, LIMIT only (TABLESAMPLE, virtual columns)

3.Hive元数据

常见错误:启动Hive时,无法初始化metastore数据库,无法创建连接,无法创建会话。

1、hive的metastore数据库丢失了,比如drop,比如文件损坏

2、metasotre版本号不对。

3、远程表服务

备份的基本语法:

$ mysqldump -uroot -p metastore > metastore.sql

还原的基本语法:

$ mysql -uroot -p metastore < metastore.sql

find命令,查找metastore.sql默认存放位置

4.Hive任务调度

oozie/azakban/crontab

hive -e "" ;

hive -f 文件名.hql ;

#举例

bin/hive hive -e "SELECT * FROM emp";

bin/hive hive -f "emp.hql";

5.查看历史命令存放地

cat ~/.hivehistory;

6.临时生效

set hive.cli.print.header = false;

7.HiveServer2

* HiveServer2

配置:hive-site.xml

hive.server2.thrift.port --> 10000

hive.server2.thrift.bind.host --> jdf.node1.com

hive.server2.long.polling.timeout -- > 5000(去掉L)

hive.server2.enable.doAs --> false

检查端口:

$ sudo netstat -antp | grep 10000

启动服务:

$ bin/hive --service hiveserver2

连接服务:

$ bin/beeline

beeline> !connect jdbc:hive2://jdf.node1.com:10000

尖叫提示:注意此时不能够执行MR任务调度,报错:

Job Submission failed with exception 'org.apache.hadoop.security.AccessControlException(Permission denied: user=anonymous, access&

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值