¿Cómo conocer las versiones de Hive y Hadoop desde el símbolo del sistema?


¿Cómo puedo encontrar qué versión de la colmena estoy usando desde el símbolo del sistema? A continuación se muestran los detalles -

Estoy usando Putty para conectarme a la tabla hive y acceder a los registros en las tablas. Así que lo que hice fue - Abrí Putty y en el nombre del host escribí - leo-ingesting.vip.name.com y luego hice clic en Open. Y luego ingresé mi nombre de usuario y contraseña y luego algunos comandos para llegar a Hive Sql. A continuación se muestra la lista de lo que hice

$ 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;

Así que hay alguna manera de que desde el símbolo del sistema pueda encontrar qué versión de la colmena estoy usando ¿y la versión Hadoop también?

 68
Author: Jacek Laskowski, 2012-07-03

24 answers

No puede obtener la versión de la colmena desde la línea de comandos.

Usted puede checkout versión hadoop como se menciona por Dave.

También si está utilizando la distribución de cloudera, mire directamente las libs:

Ls/usr/lib/hive/ lib / and check for hive library

hive-hwi-0.7.1-cdh3u3.jar

También puede comprobar las versiones compatibles aquí:

Http://www.cloudera.com/content/cloudera/en/documentation/cdh5/v5-1-x/CDH-Version-and-Packaging-Information/CDH-Version-and-Packaging-Information.html

 30
Author: pyfunc,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-18 20:16:45
$ hive --version
Hive version 0.8.1.3

EDITAR: se agregó otro '-' antes de la versión. No funciona para versiones más nuevas. Espero que funcione para todos ahora.

Se sabe que funciona en las siguientes distribuciones:

  • Distribución de HortonWorks: $ hive --version Hive 0.14.0.2.2.0.0-2041
  • CDH 5.3

No funciona:

  • CDH 4.3
  • HDInsight (Azure)
 114
Author: dfrankow,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-10 19:14:48
$ hadoop version
Hadoop 0.20.2-cdh3u4

Sin embargo, no estoy seguro de que pueda obtener la versión de la colmena desde la línea de comandos. Quizás podrías usar algo como la propiedad hive.hwi.war.file o sacarla del classpath, sin embargo.

 29
Author: Dave Newton,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-07-03 00:14:36
hive -e "set hive.hwi.war.file;" | cut -d'-' -f3
 12
Author: David,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-03 18:07:18

Esto ciertamente debería funcionar:

hive --version
 9
Author: Manas Jani,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-19 19:49:54

Del problema de la shell de la colmena 'set system.sol.Java.orden" La colmena-cli.la versión jar es la versión 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>

 7
Author: Jai Prakash,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-05 23:47:42

Podemos encontrar la versión de colmena por

  • en el shell de linux:" hive version version "
  • en la cáscara de la colmena:"! hive version version; "

Above cmds funciona en hive 0.13 y superior.

Sistema de puesta: sol.Java.comando;
da la versión de la colmena desde hue hive editor da el nombre de la jar que incluye la versión.

 7
Author: Abhishek,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-25 10:07:51
hive --version

hadoop version
 7
Author: MysticForce,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-07 06:33:20

Lo siguiente funciona en Hadoop 2.7.2

hive --version

hadoop version

pig --version

sqoop version

oozie version
 7
Author: viru,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-13 10:17:35

Debajo del comando funciona, probé esto y obtuve la versión actual como

/usr/bin/hive --version
 5
Author: Navneet Kumar,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-07 22:16:13

También podemos obtener la versión mirando la versión del archivo jar hive-metastore.

Por ejemplo:

$ ls /usr/lib/hive/lib/ | grep metastore
hive-metastore-0.13.1.jar
 2
Author: Pratik Khadloya,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-12 18:54:44

Puede obtener la versión de Colmena

hive --version

Si desea conocer la versión de hive y sus versiones de paquetes relacionadas.

rpm -qa|grep hive

La salida será como abajo.

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

Este último da una mejor comprensión de la colmena y sus dependientes. Sin embargo rpm debe estar presente.

 2
Author: Balaswamy Vaddeman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-08-17 09:47:10

Utilice el siguiente comando para obtener la versión de hive

Hive version service version

 2
Author: Karthik Sridhar,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-11-25 12:47:51

Si está utilizando beeline para conectarse a hive, entonces !dbinfo dará todos los detalles de la base de datos subyacente y en la salida getDatabaseProductVersion tendrá la versión de la base de datos de hive.

Salida de muestra: getDatabaseProductVersion 1.2.1000.2.4.3.0-227

 2
Author: venkata,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-10 23:20:03

Otra forma es hacer una llamada REST, si tiene WebHCat (parte del proyecto Hive) instalado, es

curl -i http://172.22.123.63:50111/templeton/v1/version/hive?user.name=foo

Que volverá con JSON como

{"module": "hive", "version":"1.2.1.2.3.0.0-2458"}

WebHCat docs tiene algunos detalles

 1
Author: Eugene,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-06-26 22:32:54

Sí puede obtener la versión de su colmena usando "comando de colmena":

hive --service version

Puede obtener una lista de nombres de servicio disponibles utilizando el siguiente "comando hive":

hive --service help
 1
Author: Seema Pal,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-31 16:22:18

Si está usando hortonworks distro entonces usando CLI puede obtener la versión con el comando:

hive --version

Ejemplo de salida

 1
Author: Sumeet Singh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-12-18 09:08:53

Puede buscar el archivo jar tan pronto como inicie sesión en hive

jar:file:/opt/mapr/hive/hive-0.12/lib/hive-common-0.12-mapr-1401-140130.jar!/hive-log4j.properties
 0
Author: Shanu,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-24 09:26:46

/usr/bin/hive version version funcionó para mí.

[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 ~]$
 0
Author: ,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-16 10:10:23

En HDInsight probé la versión hive version, pero no reconoció la opción ni la mencionó en la ayuda.

D:\Users\admin1>%hive_home%/bin/hive --version
Unrecognized option: --version
usage: hive
 -d,--define <key=value>          Variable subsitution to apply to hive
                                  commands. e.g. -d A=B or --define A=B
    --database <databasename>     Specify the database to use
 -e <quoted-query-string>         SQL from command line
 -f <filename>                    SQL from files
 -H,--help                        Print help information
 -h <hostname>                    connecting to Hive Server on remote host
    --hiveconf <property=value>   Use value for given property
    --hivevar <key=value>         Variable subsitution to apply to hive
                                  commands. e.g. --hivevar A=B
 -i <filename>                    Initialization SQL file
 -p <port>                        connecting to Hive Server on port number
 -S,--silent                      Silent mode in interactive shell
 -v,--verbose                     Verbose mode (echo executed SQL to the
                                  console)

Sin embargo, cuando inicia sesión en el nodo principal e inicia la consola de la colmena, imprime información de configuración útil desde la que se puede leer la versión:

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;

De esto diría que tengo la versión 0.13 de Hive desplegada, que es consistente con esta lista de versiones https://hive.apache.org/downloads.html

 0
Author: Mike Wise,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-09-07 10:23:17

Desde su conexión SSH al nodo edge, simplemente puede escribir

hive --version

Hive 1.2.1000.x.x.x.x-xx

Esto devuelve la versión de la colmena para su distribución de Hadoop. Otro enfoque es si entras en beeline, puedes encontrar la versión de inmediato.

beeline
Beeline version 1.2.1000.x.x.x.x-xx by Apache Hive
 0
Author: Piyush P,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-07-03 03:37:00

Puede obtener la versión desde la línea de comandos.

hive> select version();
OK
1.1.0-cdh5.12.0 rUnknown
Time taken: 2.815 seconds, Fetched: 1 row(s)
hive>
 0
Author: Konstantin Svintsov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-03 05:05:08

Utilice el indicador de versión de la CLI

[hadoop@usernode~]$ hadoop version
Hadoop 2.7.3-amzn-1
Subversion [email protected]:/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
 0
Author: Savio D'Souza,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-10 17:17:27

Pude obtener la versión de Hadoop 3.0.3 instalada con el siguiente comando
HAD HADOOP_HOME / bin bin ./ versión hadoop
que me dio la siguiente salida

Hadoop 3.0.3
Repositorio de código fuente https://[email protected]/repos/asf/hadoop.git - r 37fd7d752db73d984dc31e0cdfd590d252f5e075
Compilado por yzhang en 2018-05-31T17: 12Z
Compilado con el protocolo 2.5.0
Desde el origen con suma de comprobación 736cdcefa911261ad56d2d120bf1fa
Este comando se ejecutó utilizando /usr / local/hadoop/share/hadoop/common / hadoop-common-3.0.3.jar

 0
Author: vishwachandra,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-30 14:41:59