http://www.aboutyun.com/thread-18338-1-1.html
软件版本:
hive1.2.1 ,eclipse4.5,maven3.2 ,JDK1.7
软件准备:
hive:
环境准备:
(1). 安装好的Hadoop集群(伪分布式亦可);
(2) linux 下maven环境;(这里需要说下,maven编译hive,在windows下是不通的,因为里面需要bash的支持,所以直接使用linux编译hive就好)
0. 编译前,建议把maven的local_reposity 配置下,同时配置源如下(开源中国的maven源,相对国外的源较快):
01
02
03
04
05
06
07
08
09
10
11
12
|
<mirror>
<id>nexus-osc</id>
<mirrorOf>central</mirrorOf>
<name>Nexus osc</name>
<url>http:
//maven.oschina.net/content/groups/public/</url>
</mirror>
<mirror>
<id>nexus-osc-thirdparty</id>
<mirrorOf>thirdparty</mirrorOf>
<name>Nexus osc thirdparty</name>
<url>http:
//maven.oschina.net/content ... dparty/</url>
</mirror>
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
[INFO] Reactor Summary:
[INFO]
[INFO] Hive ............................................... SUCCESS [
4.457
s]
[INFO] Hive Shims Common .................................. SUCCESS [
5.047
s]
[INFO] Hive Shims
0
.20S ................................... SUCCESS [
2.017
s]
[INFO] Hive Shims
0.23
.................................... SUCCESS [
7.157
s]
[INFO] Hive Shims Scheduler ............................... SUCCESS [
1.796
s]
[INFO] Hive Shims ......................................... SUCCESS [
1.674
s]
[INFO] Hive Common ........................................ SUCCESS [
5.711
s]
[INFO] Hive Serde ......................................... SUCCESS [
7.577
s]
[INFO] Hive Metastore ..................................... SUCCESS [
18.044
s]
[INFO] Hive Ant Utilities ................................. SUCCESS [
1.373
s]
[INFO] Spark Remote Client ................................ SUCCESS [
10.962
s]
[INFO] Hive Query Language ................................ SUCCESS [
05
:
12
min]
[INFO] Hive Service ....................................... SUCCESS [
42.408
s]
[INFO] Hive Accumulo Handler .............................. SUCCESS [
01
:
40
min]
[INFO] Hive JDBC .......................................... SUCCESS [
9.021
s]
[INFO] Hive Beeline ....................................... SUCCESS [
12.194
s]
[INFO] Hive CLI ........................................... SUCCESS [
12.576
s]
[INFO] Hive Contrib ....................................... SUCCESS [
3.031
s]
[INFO] Hive HBase Handler ................................. SUCCESS [
01
:
54
min]
[INFO] Hive HCatalog ...................................... SUCCESS [
28.797
s]
[INFO] Hive HCatalog Core ................................. SUCCESS [
5.609
s]
[INFO] Hive HCatalog Pig Adapter .......................... SUCCESS [
23.254
s]
[INFO] Hive HCatalog Server Extensions .................... SUCCESS [
01
:
15
min]
[INFO] Hive HCatalog Webhcat Java Client .................. SUCCESS [
2.036
s]
[INFO] Hive HCatalog Webhcat .............................. SUCCESS [
49.390
s]
[INFO] Hive HCatalog Streaming ............................ SUCCESS [
4.387
s]
[INFO] Hive HWI ........................................... SUCCESS [
1.768
s]
[INFO] Hive ODBC .......................................... SUCCESS [
1.053
s]
[INFO] Hive Shims Aggregator .............................. SUCCESS [
0.111
s]
[INFO] Hive TestUtils ..................................... SUCCESS [
0.550
s]
[INFO] Hive Packaging ..................................... SUCCESS [
3.195
s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:
14
:
31
min
[INFO] Finished at:
2015
-
10
-15T05:
25
:
11
-
07
:
00
[INFO] Final Memory: 89M/416M
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
[INFO] Reactor Summary:
[INFO]
[INFO] Hive ............................................... SUCCESS [
7.396
s]
[INFO] Hive Shims Common .................................. SUCCESS [
3.983
s]
[INFO] Hive Shims
0
.20S ................................... SUCCESS [
2.734
s]
[INFO] Hive Shims
0.23
.................................... SUCCESS [
16.801
s]
[INFO] Hive Shims Scheduler ............................... SUCCESS [
2.143
s]
[INFO] Hive Shims ......................................... SUCCESS [
1.958
s]
[INFO] Hive Common ........................................ SUCCESS [
4.495
s]
[INFO] Hive Serde ......................................... SUCCESS [
6.760
s]
[INFO] Hive Metastore ..................................... SUCCESS [
3.512
s]
[INFO] Hive Ant Utilities ................................. SUCCESS [
0.252
s]
[INFO] Spark Remote Client ................................ SUCCESS [
6.719
s]
[INFO] Hive Query Language ................................ SUCCESS [
7.988
s]
[INFO] Hive Service ....................................... SUCCESS [
55.204
s]
[INFO] Hive Accumulo Handler .............................. SUCCESS [
11
:
49
min]
[INFO] Hive JDBC .......................................... SUCCESS [
1.607
s]
[INFO] Hive Beeline ....................................... SUCCESS [
35
:
22
min]
[INFO] Hive CLI ........................................... SUCCESS [
01
:
28
min]
[INFO] Hive Contrib ....................................... SUCCESS [
1.797
s]
[INFO] Hive HBase Handler ................................. SUCCESS [
10
:
35
min]
[INFO] Hive HCatalog ...................................... SUCCESS [
5.775
s]
[INFO] Hive HCatalog Core ................................. SUCCESS [
01
:
23
min]
[INFO] Hive HCatalog Pig Adapter .......................... SUCCESS [
01
:
10
min]
[INFO] Hive HCatalog Server Extensions .................... SUCCESS [
07
:
20
min]
[INFO] Hive HCatalog Webhcat Java Client .................. SUCCESS [
1.968
s]
[INFO] Hive HCatalog Webhcat .............................. SUCCESS [
01
:
53
min]
[INFO] Hive HCatalog Streaming ............................ SUCCESS [
2.089
s]
[INFO] Hive HWI ........................................... SUCCESS [
1.816
s]
[INFO] Hive ODBC .......................................... SUCCESS [
1.284
s]
[INFO] Hive Shims Aggregator .............................. SUCCESS [
0.064
s]
[INFO] Hive TestUtils ..................................... SUCCESS [
2.947
s]
[INFO] Hive Packaging ..................................... SUCCESS [
2.837
s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:
01
:
13
h
[INFO] Finished at:
2015
-
10
-15T19:
53
:
05
-
07
:
00
[INFO] Final Memory: 68M/306M
|
1
2
3
4
|
Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
2015
-
10
-
22
22
:
25
:
19
,
837
INFO [main] (HiveMetaStoreClient.java:
376
) - Trying to connect to metastore with URI thrift:
//192.168.0.100:9083
Exception in thread
"main"
java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:
522
)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:
662
)
at test.MainTest.main(MainTest.java:
8
)
Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:
1523
)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:
86
)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:
132
)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:
104
)
at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:
3005
)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:
3024
)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:
503
)
...
2
more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
57
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
45
)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
526
)
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:
1521
)
...
8
more
Caused by: java.lang.NullPointerException
at java.lang.ProcessBuilder.start(ProcessBuilder.java:
1010
)
at org.apache.hadoop.util.Shell.runCommand(Shell.java:
482
)
at org.apache.hadoop.util.Shell.run(Shell.java:
455
)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:
715
)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:
808
)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:
791
)
at org.apache.hadoop.security.ShellBasedUnixGroupsMapping.getUnixGroups(ShellBasedUnixGroupsMapping.java:
84
)
at org.apache.hadoop.security.ShellBasedUnixGroupsMapping.getGroups(ShellBasedUnixGroupsMapping.java:
52
)
at org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback.getGroups(JniBasedUnixGroupsMappingWithFallback.java:
51
)
at org.apache.hadoop.security.Groups.getGroups(Groups.java:
176
)
at org.apache.hadoop.security.UserGroupInformation.getGroupNames(UserGroupInformation.java:
1488
)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.open(HiveMetaStoreClient.java:
436
)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:
236
)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:
74
)
...
13
more
|
1
|
Could
not
locate executable D
:
\jars\hadoop
2.6
\hadoop
-2.6
.
0
\bin\winutils.exe
in
the
Hadoop binarie
|