大数据工具篇之Hive与HBase整合完整教程.docx
- 文档编号:3282155
- 上传时间:2022-11-21
- 格式:DOCX
- 页数:61
- 大小:52.66KB
大数据工具篇之Hive与HBase整合完整教程.docx
《大数据工具篇之Hive与HBase整合完整教程.docx》由会员分享,可在线阅读,更多相关《大数据工具篇之Hive与HBase整合完整教程.docx(61页珍藏版)》请在冰豆网上搜索。
大数据工具篇之Hive与HBase整合完整教程
大数据工具篇之Hive与HBase整合完整教程
一、引言
最近的一次培训,用户特意提到Hadoop环境下HDFS中存储的文件如何才能导入到HBase,关于这部分基于HBaseJavaAPI的写入方式,之前曾经有过技术文章共享,本文就不再说明。
本文基于Hive执行HDFS批量向HBase导入数据,讲解Hive与HBase的整合问题。
这方面的文章已经很多,但是由于版本差异,可操作性不大,本文采用的版本均基于以下版本说明中的版本。
二、版本说明
序号
软件
版本
1
Hive
0.10.0
2
HBase
0.94.0
3
Hadoop
1.0.1
三、配置指南
cpconf/hive-default.xml.template hive-default.xml
cpconf/hive-default.xml.template hive-site.xml
基于hive-default.xml.template进行拷贝复制的hive-site.xml文件有问题,主要集中在
1
xmlversion="1.0"?
>
2
xml-stylesheettype="text/xsl"href="configuration.xsl"?
>
3
--
4LicensedtotheApacheSoftwareFoundation(ASF)underoneormore
5contributorlicenseagreements.SeetheNOTICEfiledistributedwith
6thisworkforadditionalinformationregardingcopyrightownership.
7TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0
8(the"License");youmaynotusethisfileexceptincompliancewith
9theLicense.YoumayobtainacopyoftheLicenseat
10
11http:
//www.apache.org/licenses/LICENSE-2.0
12
13Unlessrequiredbyapplicablelaworagreedtoinwriting,software
14distributedundertheLicenseisdistributedonan"ASIS"BASIS,
15WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
16SeetheLicenseforthespecificlanguagegoverningpermissionsand
17limitationsundertheLicense.
18-->
19
20
21
22
--WARNING!
!
!
ThisfileisprovidedfordocumentationpurposesONLY!
-->
23
--WARNING!
!
!
AnychangesyoumaketothisfilewillbeignoredbyHive.-->
24
--WARNING!
!
!
Youmustmakeyourchangesinhive-site.xmlinstead.-->
25
26
27
--HiveExecutionParameters-->
28
29
30
31
32toaprimeclosetothenumberofavailablehosts.Ignoredwhen
33mapred.job.trackeris"local".Hadoopsetthisto1bydefault,whereashiveuses-1asitsdefaultvalue.
34Bysettingthispropertyto-1,Hivewillautomaticallyfigureoutwhatshouldbethenumberofreducers.
35
36
37
38
39
40
41
42
43
44
45
46
47
48specifiedintheconfigurationparametermapred.reduce.tasksis
49negative,hivewillusethisoneasthemaxnumberofreducerswhen
50automaticallydeterminenumberofreducers.
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69thisconfigurationvalue.Variablesubstitutionwillonlybeinvokedatthehive
70clistartup.
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--Iftheinputtableisnotbucketed,thedenominatorofthetablesampleisdeterminiedbytheparameterbelow-->
98
--Forexample,thefollowingquery:
-->
99
--INSERTOVERWRITETABLEdest-->
100
--SELECTcol1fromsrc-->
101
--wouldbeconvertedto-->
102
--INSERTOVERWRITETABLEtest_dest-->
103
--SELECTcol1fromsrcTABLESAMPLE(BUCKET1outof32onrand
(1))-->
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
derby:
;databaseName=metastore_db;create=true
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据 工具 Hive HBase 整合 完整 教程