Hadoop 蜂箱罐';无法通过hiveserver2创建表
我正在构建一个最简单的配置单元服务器(v2.1.1),并希望在其上创建一个简单的表。但是一个错误遭遇:Hadoop 蜂箱罐';无法通过hiveserver2创建表,hadoop,hive,Hadoop,Hive,我正在构建一个最简单的配置单元服务器(v2.1.1),并希望在其上创建一个简单的表。但是一个错误遭遇: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:file:/user/hive/warehouse/test2 is not a directory or unable to create one) 我在CLI上的sql是创
FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.DDLTask.
MetaException(message:file:/user/hive/warehouse/test2 is not a directory
or unable to create one)
我在CLI上的sql是创建表test2(id int)
,这非常简单。
我已经在hive
和beeline
的CLI上测试了sql,此外,JDBC也有相同的错误输出
其他事项:1. <代码>显示表格工作正常。
2.在
1) hive-site.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.1.230:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.server2.enable.impersonation</name>
<description>Enable user impersonation for HiveServer2</description>
<value>true</value>
</property>
</configuration>
更新我想这可能是hdfs用户的设置问题,但我不确定在哪里可以找到所有相关设置。它正在尝试从本地获取位置。确保hive-site.xml具有如下配置
<property>
<name>hive.metastore.warehouse.dir</name>
<value>hdfs://CP000187:9000/user/hive/warehouse</value>
<description>location of default database for the
warehouse</description>
</property>
hive.metastore.warehouse.dir
hdfs://CP000187:9000/user/hive/warehouse
服务器的默认数据库的位置
仓库
我的第一个猜测是权限/用户问题。如果您暂时使用chmod 777,是否有帮助?(甚至创建所需的目录和chmod 777)。不适用于hadoop fs-chmod 777/user/hive/warehouse
。无论如何,谢谢。你能创建一个数据库(以及其中的一个表吗?)我不确定是否能直接在仓库中创建表(通常你至少会有一个默认数据库左右)@DennisJaheruddin,无法创建数据库…我记得默认数据库的表保存在warehouse dir。请尝试创建一个外部表,该表的文件位置位于您可以访问的空间。配置单元用户标识似乎无法将数据写入元存储。
<configuration>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
<description>Allow the superuser oozie to impersonate any members of the group group1 and group2</description>
</property>
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
<description>The superuser can connect only from host1 and host2 to impersonate a user</description>
</property>
</configuration>
hive> create database testdb;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Unable to create database path file:/user/hive/warehouse/testdb.db, failed to create database testdb)
<property>
<name>hive.metastore.warehouse.dir</name>
<value>hdfs://CP000187:9000/user/hive/warehouse</value>
<description>location of default database for the
warehouse</description>
</property>