JDBC连接Hive(包括Maven配置和本地jar配置)

查看服务器hive和hadoop版本

可以使用hadoop version和hive命令查看hadoop版本

[guser@hadoop-hive01 hadoop]$ hadoop version
Hadoop 2.6.0-cdh5.9.0
Subversion http://github.com/cloudera/hadoop -r 1c8ae0d951319fea693402c9f82449447fd27b07
Compiled by jenkins on 2016-10-21T08:10Z
Compiled with protoc 2.5.0
From source with checksum 5448863f1e597b97d9464796b0a451
This command was run using /usr/lib/hadoop/hadoop-common-2.6.0-cdh5.9.0.jar
[guser@hadoop-hive01 hadoop]$ hive
2017-08-01 16:43:28,717 WARN  [main] mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present.  Continuing without it.

Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-exec-1.1.0-cdh5.9.0.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive> 

jar依赖包

所依赖的jar包,一共有以下几个

$HADOOP_HOME/hadoop-common-${hadoop_version}.jar
$HIVE_HOME/lib/hive-exec-${hive_version}.jar 
$HIVE_HOME/lib/hive-jdbc-${hive_version}.jar 
$HIVE_HOME/lib/hive-metastore-${hive_version}.jar  
$HIVE_HOME/lib/hive-service-${hive_version}.jar   
$HIVE_HOME/lib/libfb303-0.9.3.jar  
$HIVE_HOME/lib/commons-logging-1.1.3.jar 
httpcore-4.2.5.jar
httpclient-4.2.5.jar
slf4j-api-1.6.1.jar

maven配置

	<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
			<version>2.6.0</version>
		</dependency>

		<dependency>
			<groupId>org.apache.hive</groupId>
			<artifactId>hive-jdbc</artifactId>
			<version>1.1.0</version>
		</dependency>
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页