资源预览内容
第1页 / 共53页
第2页 / 共53页
第3页 / 共53页
第4页 / 共53页
第5页 / 共53页
第6页 / 共53页
第7页 / 共53页
第8页 / 共53页
第9页 / 共53页
第10页 / 共53页
亲,该文档总共53页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
大数据工具篇之Hive与HBase整合完整教程一、引言最近的一次培训,用户特意提到 Hadoop 环境下 HDFS 中存储的文件如何才能导入 到 HBase ,关于这部分基于 HBase Java API 的写入方式,之前曾经有过技术文 章共享,本文就不再说明。本文基于Hive执行HDFS批量向HBase导入数据,讲 解 Hive 与 HBase 的整合 问题。这方面的文章已经很多,但是由于版本差异,可 操作性不大,本文采用的版本均基于以下版本说明中的版本。二、版本说明序号 软件 版本1 Hive 0.10.02 HBase 0.94.03 Hadoop 1.0.1三、配置指南cp conf/hive-default.xml.template hive-default.xmlcp conf/hive-default.xml.template hive-site.xml基于 hive-default.xml.template 进行拷贝复制的 hive-site.xml 文件有问题, 主要集中在description标签不配对的情况,需要根据错误提 示进行修改,修改完成后的配置文件 如下所示:E1 231920 2122 23 24 252627 28 29 mapred.reduce.tasks30 -131 The default number of reduce tasks per job. Typically set32 to a prime close to the number of available hosts. Ignored when33 mapred.job.tracker is local. Hadoop set this to 1 by default, whereas hive uses -1 as its default value.34 By setting this property to -1, Hive will automatically figure out what should be the number of reducers.35 36 3738 39 hive.exec.reducers.bytes.per.reducer40 100000000041 size per reducer.The default is 1G, i.e if the input size is 10G, it will use 10 reducers.42 4344 45 hive.exec.reducers.max46 99947 max number of reducers will be used. If the one48 specified in the configuration parameter mapred.reduce.tasks is49 negative, hive will use this one as the max number of reducers when50 automatically determine number of reducers.51 5253 54 hive.cli.print.header55 false56 Whether to print the names of the columns in query output.57 5859 60 hive.cli.print.current.db61 false62 Whether to include the current database in the hive prompt.63 6465 66 hive.cli.prompt67 hive68 Command line prompt configuration value. Other hiveconf can be used in69 this configuration value. Variable substitution will onlybe invoked at the hive70 cli startup.71 7273 74 hive.exec.scratchdir75 /tmp/hive-$user.name76 Scratch space for Hive jobs77 7879 80 hive.exec.local.scratchdir81 /tmp/$user.name82 Local scratch space for Hive jobs83 8485 86 hive.test.mode87 false88 whether hive is running in test mode. If yes, it turns on sampling and prefixes the output tablename89 9091 92 hive.test.mode.prefix93 test_94 if hive is running in test mode, prefixes the output table by this string95 9697 98 99 100 101 102 103 104 105 hive.test.mode.samplefreq106 32107 if hive is running in test mode and table is not bucketed, sampling frequency108 109110 111 hive.test.mode.nosamplelist112 valu
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号