如何从命令提示符知道Hive和Hadoop版本?
如何从命令提示符中找到我正在使用的Hive版本。 以下是详情 -
我使用Putty连接到hive表并访问表中的记录。 所以我做的是 - 我打开Putty并在主机名中键入 - leo-ingesting.vip.name.com然后我点击Open.然后我输入了我的用户名和密码,然后输入了很少的命令来到Hive sql。 以下是我所做的清单
$ bash
bash-3.00$ hive
Hive history file=/tmp/rkost/hive_job_log_rkost_201207010451_1212680168.txt
hive> set mapred.job.queue.name=hdmi-technology;
hive> select * from table LIMIT 1;
那么从命令提示符是否有任何方法我可以找到我正在使用的Hive版本和Hadoop版本?
arsenal asked 2019-09-17T08:09:49Z
24个解决方案
123 votes
$ hive --version
Hive version 0.8.1.3
编辑:在版本之前添加了另一个' - '。 不适用于较新的版本。 希望它现在适用于所有人。
已知可在以下发行版中使用:
HortonWorks发行版:$ hive --version Hive 0.14.0.2.2.0.0-2041
CDH 5.3
这是行不通的:
CDH 4.3
HDinsight(Azure)
dfrankow answered 2019-09-17T08:11:44Z
32 votes
您无法从命令行获取配置单元版本。
您可以查看Dave提到的hadoop版本。
此外,如果您使用cloudera发行版,那么直接查看libs:
ls / usr / lib / hive / lib /并检查hive库
hive-hwi-0.7.1-cdh3u3.jar
您还可以在此处查看兼容版本:
[http://www.cloudera.com/content/cloudera/en/documentation/cdh5/v5-1-x/CDH-Version-and-Packaging-Information/CDH-Version-and-Packaging-Information.html]
pyfunc answered 2019-09-17T08:10:41Z
31 votes
$ hadoop version
Hadoop 0.20.2-cdh3u4
但是,不确定您是否可以从命令行获取Hive版本。 也许您可以使用类似hive.hwi.war.file属性的东西或将其拉出类路径。
Dave Newton answered 2019-09-17T08:12:09Z
12 votes
hive -e "set hive.hwi.war.file;" | cut -d'-' -f3
David answered 2019-09-17T08:12:28Z
11 votes
这肯定会奏效:
hive --version
Manas Jani answered 2019-09-17T08:12:53Z
7 votes
从hive shell发出'set system.sun.java.command'hive-cli.jar版本是hive版本。
hive> set system:sun.java.command;
system:sun.java.command=org.apache.hadoop.util.RunJar /opt/cloudera/parcels/CDH-4.2.2-1.cdh4.2.2.p0.10/bin/../lib/hive/lib/hive-cli-0.10.0-cdh4.2.2.jar org.apache.hadoop.hive.cli.CliDriver
hive>
Jai Prakash answered 2019-09-17T08:13:24Z
7 votes
我们可以找到hive版本
在linux shell上:“hive --version”
在蜂巢壳上:“!hive --version;”
以上cmds适用于蜂巢0.13及以上。
设置系统:sun.java.command;
从hue hive编辑器给出hive版本,它给出了包含版本的jar名称。
Abhishek answered 2019-09-17T08:14:21Z
7 votes
hive --version
hadoop version
MysticForce answered 2019-09-17T08:14:39Z
7 votes
以下适用于Hadoop 2.7.2
hive --version
hadoop version
pig --version
sqoop version
oozie version
viru answered 2019-09-17T08:15:03Z
5 votes
下面的命令工作,我试过这个,并获得当前版本
/usr/bin/hive --version
Navneet Kumar answered 2019-09-17T08:15:28Z
4 votes
您可以从命令行获取版本。
hive> select version();
OK
1.1.0-cdh5.12.0 rUnknown
Time taken: 2.815 seconds, Fetched: 1 row(s)
hive>
Konstantin Svintsov answered 2019-09-17T08:15:53Z
3 votes
如果您使用getDatabaseProductVersion 1.2.1000.2.4.3.0-227连接到配置单元,则!dbinfo将提供所有基础数据库详细信息,并且在输出getDatabaseProductVersion中将具有配置单元数据库版本。
样本输出:getDatabaseProductVersion 1.2.1000.2.4.3.0-227
venkata answered 2019-09-17T08:16:27Z
3 votes
使用CLI中的版本标志
[hadoop@usernode~]$ hadoop version
Hadoop 2.7.3-amzn-1
Subversion git@aws157git.com:/pkg/Aws157BigTop -r d94115f47e58e29d8113a887a1f5c9960c61ab83
Compiled by ec2-user on 2017-01-31T19:18Z
Compiled with protoc 2.5.0
From source with checksum 1833aada17b94cfb94ad40ccd02d3df8
This command was run using /usr/lib/hadoop/hadoop-common-2.7.3-amzn-1.jar
[hadoop@usernode ~]$ hive --version
Hive 1.0.0-amzn-8
Subversion git://ip-10-69-189-31/workspace/workspace/bigtop.release-rpm-4.8.4/build/hive/rpm/BUILD/apache-hive-1.0.0-amzn-8-src -r d94115f47e58e29d8113a887a1f5c9960c61ab83
Compiled by ec2-user on Tue Jan 31 19:51:34 UTC 2017
From source with checksum 298304aab1c4240a868146213f9ce15f
Savio D'Souza answered 2019-09-17T08:16:53Z
2 votes
我们还可以通过查看hive-Metoreore jar文件的版本来获取该版本。
例如:
$ ls /usr/lib/hive/lib/ | grep metastore
hive-metastore-0.13.1.jar
Pratik Khadloya answered 2019-09-17T08:17:21Z
2 votes
你可以得到Hive版本
hive --version
如果你想知道hive版本及其相关的软件包版本。
rpm -qa|grep hive
输出如下。
libarchive2-2.5.5-5.19
hive-0.13.0.2.1.2.2-516
perl-Archive-Zip-1.24-2.7
hive-jdbc-0.13.0.2.1.2.2-516
webhcat-tar-hive-0.13.0.2.1.2.2_516-2
hive-webhcat-0.13.0.2.1.2.2-516
hive-hcatalog-0.13.0.2.1.2.2-516
后者可以更好地了解蜂巢及其家属。 然而,rpm需要存在。
Balaswamy Vaddeman answered 2019-09-17T08:18:05Z
2 votes
使用以下命令获取配置单元版本
蜂巢 - 服务版
Karthik Sridhar answered 2019-09-17T08:18:38Z
2 votes
如果您使用的是hortonworks distro,那么使用CLI可以获得带有以下命令的版本:
hive --version
Sumeet Singh answered 2019-09-17T08:19:03Z
2 votes
从SSH连接到边缘节点,您只需键入即可
hive --version
Hive 1.2.1000.x.x.x.x-xx
这将返回Hiveop分发的Hive版本。 另一种方法是,如果您进入beeline,您可以立即找到该版本。
beeline
Beeline version 1.2.1000.x.x.x.x-xx by Apache Hive
Piyush P answered 2019-09-17T08:19:36Z
1 votes
另一种方法是进行REST调用,如果你安装了WebHCat(Hive项目的一部分),那么
curl -i http://172.22.123.63:50111/templeton/v1/version/hive?user.name=foo
这将与JSON一样回归
{ “模块”: “蜂巢”, “版本”: “1.2.1.2.3.0.0-2458”}
WebHCat文档有一些细节
Eugene answered 2019-09-17T08:20:20Z
1 votes
是的,您可以使用“hive命令”获取您的配置单元的版本:
hive --service version
您可以使用以下“hive命令”获取可用服务名称列表:
hive --service help
Seema Pal answered 2019-09-17T08:20:52Z
0 votes
您可以在登录蜂巢后立即查找jar文件
jar:file:/opt/mapr/hive/hive-0.12/lib/hive-common-0.12-mapr-1401-140130.jar!/hive-log4j.properties
Shanu answered 2019-09-17T08:21:17Z
0 votes
/ usr / bin / hive --version为我工作。
[qa@ip-10-241-1-222 ~]$ /usr/bin/hive --version
Hive 0.13.1-cdh5.3.1
Subversion file:///data/1/jenkins/workspace/generic-package-rhel64-6-0/topdir/BUILD/hive-0.13.1-cdh5.3.1 -r Unknown
Compiled by jenkins on Tue Jan 27 16:38:55 PST 2015
From source with checksum 1bb86e4899928ce29cbcaec8cf43c9b6
[qa@ip-10-241-1-222 ~]$
answered 2019-09-17T08:21:42Z
0 votes
在HDInsight上我尝试了hive --version,但它没有认识到该选项或在帮助中提及它。
D:\Users\admin1>%hive_home%/bin/hive --version
Unrecognized option: --version
usage: hive
-d,--define Variable subsitution to apply to hive
commands. e.g. -d A=B or --define A=B
--database Specify the database to use
-e SQL from command line
-f SQL from files
-H,--help Print help information
-h connecting to Hive Server on remote host
--hiveconf Use value for given property
--hivevar Variable subsitution to apply to hive
commands. e.g. --hivevar A=B
-i Initialization SQL file
-p connecting to Hive Server on port number
-S,--silent Silent mode in interactive shell
-v,--verbose Verbose mode (echo executed SQL to the
console)
但是,当您登录到头节点并启动配置单元控制台时,它会输出一些有用的配置信息,从中可以读取版本:
D:\Users\admin1>%hive_home%/bin/hive
Logging initialized using configuration in file:/C:/apps/dist/hive-0.13.0.2.1.11.0-2316/conf/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/apps/dist/hadoop-2.4.0.2.1.11.0-2316/share/hadoop/common/lib/slf4j-log4j12-1.7.5.j
ar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/apps/dist/hbase-0.98.0.2.1.11.0-2316-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4
j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive> quit;
从这个我会说我已经部署了Hive版本0.13,这与这个版本列表一致[https://hive.apache.org/downloads.html]
Mike Wise answered 2019-09-17T08:22:22Z
0 votes
我能够通过以下命令获得已安装的Hadoop 3.0.3的版本
$ HADOOP_HOME / bin $ ./hadoop版本
这给了我以下输出
Hadoop 3.0.3
源代码存储库[https://yjzhangal@git-wip-us.apache.org/repos/asf/hadoop.git] -r 37fd7d752db73d984dc31e0cdfd590d252f5e075
由yzhang编制于2018-05-31T17:12Z
用protoc 2.5.0编译
来源与校验和736cdcefa911261ad56d2d120bf1fa
此命令使用/usr/local/hadoop/share/hadoop/common/hadoop-common-3.0.3.jar运行
vishwachandra answered 2019-09-17T08:23:39Z