Java.lang.RuntimeException: No se puede crear una instancia de org.apache.hadoop.colmena.metastore.HiveMetaStoreClient


He configurado mi Colmena como se indica en el enlace: http://www.youtube.com/watch?v=Dqo1ahdBK_A , pero estoy recibiendo el siguiente error al crear una tabla en la colmena. Estoy usando hadoop-1.2.1 y hive-0.12.0.

hive> create table employee(emp_id int,name string,salary double);
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
 29
Author: dev ツ, 2014-03-28

14 answers

Parece problema con su metastore. Si está utilizando el subárbol predeterminado metastore embedded derby. El archivo de bloqueo estaría allí en caso de salida anormal. si elimina ese archivo de bloqueo, este problema se resolvería

rm   metastore_db/*.lck
 39
Author: SachinJ,
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-28 14:08:57

Esto podría ser un problema con el metastore como sachinjose descrito, o un problema de conexión. Ejecute hive console en modo de depuración de la siguiente manera:

hive -hiveconf hive.root.logger=DEBUG,console

Luego ejecute una consulta simple como show tables; y vea qué sucede. Me encontré con este problema después de reiniciar un namenode y se debió al host incorrecto que se estableció en los archivos de configuración (ec2 genera una nueva IP/nombre de host privado cuando se reinicia).

 8
Author: Ashex,
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-04-23 10:04:11

Ejecute este comando desde la consola:

./hive -hiveconf hive.root.logger=DEBUG,console

Ahora ejecuta

show databases;

Si ve una excepción como la siguiente:

java.sql.SQLException: A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection.

Significa que hay algún problema de permisos con metastore_db. Es necesario cambiar los permisos de la carpeta completa. Estoy ejecutando mi colmena como usuario de hdfs. Así que usé el comando

chown -R hdfs:hadoop * 

En el directorio de la colmena. Esto resolvió el problema.

 5
Author: Krishna Prasad Y,
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-08-27 03:55:25
hive> show databases;
FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

Para resolver este problema, inicie primero los servicios de hadoop.

$ start-all.sh

Entonces corro

hive> show database;

Funciona bien para mí.

 2
Author: user5132316,
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-20 09:04:23
rm metastore_db/*.lck

También funciona para mí. Se puede encontrar en su directorio home/user. Puede usar el comando locate para encontrarlo: locate metastore_db

Después de eliminar los archivos de bloqueo, cierre la sesión actual. Llamar a hive shell en una nueva sesión

 1
Author: Manish Agrawal,
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-01 03:32:59

Hacer colmena.metastore.esquema.verification = false in hive-site.archivo xml este error será eliminado. En mi caso está funcionando bien.

 1
Author: Sandeep Mishra,
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-01-13 03:58:04

El reinicio de la máquina virtual o el sistema también debe liberar el bloqueo.

 0
Author: Chalpat,
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-04-01 07:58:05

Esto podría deberse a más de un "metastore_db". Elimine "metastore_db", reinicie el clúster de hadoop y abra la shell de la colmena desde la carpeta {HIVE_HOME/bin

 0
Author: Tamil,
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-05-04 07:34:32

La respuesta se encuentra en http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/5.0/CDH5-Installation-Guide/cdh5ig_hive_schema_tool.html

Para suprimir la comprobación de esquema y permitir que metastore modifique implícitamente el esquema, debe establecer la colmena.metastore.esquema.verification configuration propiedad a false en hive-site.XML.

 0
Author: roshan4074,
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-07-22 13:35:15

Siendo un novato tengo el mismo conjunto de errores.
Se encontró que uno de los demonios en mi caso namenode no fue iniciado. En la instalación de hadoop sería prudente hacer un hábito para golpear él siguientes comandos:
ps-ef / grep "namenode"
ps-ef / grep "datanode"
ps-ef / grep"tracker"

Es necesario comprobar el registro correspondiente si alguno de los demonios no funciona.

 0
Author: Jignesh Rawal,
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-05-19 13:51:33

Si está en una máquina local, parece que tiene otro terminal abierto con hive shell/session. Solo puede tener una sesión utilizando la base de datos derby incrustada. Cierra todas las demás sesiones de colmena e inténtalo.

 0
Author: ajesh 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
2015-07-16 11:49:14

Eliminar código en el sitio de la colmena.xml y pegue este código en hive-site.XML.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=/home/hadoop/Desktop/apache-hive-2.1.1-bin/metastore_db;create=true</value>
<description>
JDBC connect string for a JDBC metastore.
To use SSL to encrypt/authenticate the connection, provide database-specific SSL flag in the connection URL.
For example, jdbc:postgresql://myhost/db?ssl=true for postgres database.
</description>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value/>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.PersistenceManagerFactoryClass</name>
<value>org.datanucleus.api.jdo.JDOPersistenceManagerFactory</value>
<description>class implementing the jdo persistence</description>
</property>
</configuration>
 0
Author: shivam,
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-02-03 04:10:53

Me enfrentaba al mismo problema hay algunos puntos importantes que podrían resolver este problema.

1.Ponga lo siguiente al principio de hive-site.xml

  <property>
    <name>system:java.io.tmpdir</name>
    <value>/tmp/hive/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:derby:,databaseName=$HIVE_HOME/metastore_db;create=true</value>
    <description>JDBC connect string for a JDBC metastore </description>
  </property>

Se establece la ruta relativa en URI absoluto y se configura Metastore donde se almacena la base de datos

2.Remove $HIVE_HOME/metastore_db Pero tenga en cuenta que esto eliminará su esquema por completo!

3.Ahora, debes Inicializar Derby database.By por defecto, Hive usa Derby database

H HIVE_HOME/bin / schematool-initSchema-DbType derby

También supongo que su variable de entorno se ha establecido correctamente, si no, compruebe que se ven como a continuación:

export HADOOP_HOME=/usr/local/hadoop 
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HIVE_HOME=/usr/lib/hive
export PATH=$PATH:$HIVE_HOME/bin

Y luego ejecute el comando hive y escriba show databases;

 0
Author: Hamid,
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-24 12:46:44

Me enfrentaba al mismo problema used usé los siguientes pasos para resolverlo:

  1. Cree un archivo hive-site.xml e introduzca los detalles (para el modo Local / Prod). Asegúrese de que exista la siguiente ubicación/home/hadoop/bhishm / warehouse

    Ejemplo:

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>/home/hadoop/bhishm/warehouse</value>
        <description>
        Local or HDFS directory where Hive keeps table contents.
        </description>
    </property>
    <property>
        <name>hive.metastore.local</name>
        <value>true</value>
        <description>
        Use false if a production metastore server is used.
        </description>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:derby:;databaseName=/home/hadoop/bhishm/warehouse/metastore_db;create=true</value>
        <description>
        The JDBC connection URL.
        </description>
    </property>
    </configuration>
    
  2. Editar el hive-env.sh add > añadir la ruta java como primera línea después de reducir el uso de memoria:

    Ejemplo:

    # Hive Client memory usage can be an issue if a large number of clients
    # are running at the same time. The flags below have been useful in 
    # reducing memory usage:
    
    # The java implementation to use.  Required.
    
    export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
    
  3. Ejecute la consulta de la colmena.

 -1
Author: user2181047,
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-15 00:09:15