当前位置: 首页 > 知识库问答 >
问题:

无法通过JDBC连接创建配置单元表

尉迟国发
2023-03-14

我正在我的ubuntu上运行Hive2,并尝试通过hive接口和Beeline\JDBC创建表。我通过配置单元接口创建表没有问题,但是当通过jdbc访问时,我得到一个权限被拒绝的错误。

 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: org.apache.hadoop.security.AccessControlException Permission denied: user=hive, access=WRITE, inode="/user/hive/warehouse/page_view":cto:supergroup:drwxrwxr-x

异常中,我看到它试图在一个不存在的目录中创建表(/user/hive/warehouse/...)

<property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/usr/local/apache-hive-1.2.1-bin/metastore_db</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>hive.metastore.connect.retries</name>
    <value>3</value>
    <description>Number of retries while opening a connection to metastore</description>
  </property>
  <property>
    <name>hive.metastore.failure.retries</name>
    <value>1</value>
    <description>Number of retries upon failure of Thrift metastore calls</description>
  </property>
  <property>
    <name>hive.metastore.client.connect.retry.delay</name>
    <value>1s</value>
    <description>
      Expects a time value with unit (d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec), which is sec if not specified.
      Number of seconds for the client to wait between consecutive connection attempts
    </description>
  </property>
  <property>
    <name>hive.metastore.client.socket.timeout</name>
    <value>600s</value>
    <description>
      Expects a time value with unit (d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec), which is sec if not specified.
      MetaStore Client socket timeout in seconds
    </description>
  </property>
  <property>
    <name>hive.metastore.client.socket.lifetime</name>
    <value>0s</value>
    <description>
      Expects a time value with unit (d/day, h/hour, m/min, s/sec, ms/msec, us/usec, ns/nsec), which is sec if not specified.
      MetaStore Client socket lifetime in seconds. After this time is exceeded, client
      reconnects on the next MetaStore operation. A value of 0s means the connection
      has an infinite lifetime.
    </description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>mine</value>
    <description>password to use against metastore database</description>
  </property>
  <property>
    <name>hive.metastore.ds.connection.url.hook</name>
    <value/>
    <description>Name of the hook to use for retrieving the JDO connection URL. If empty, the value in javax.jdo.option.ConnectionURL is used</description>
  </property>
  <property>
    <name>javax.jdo.option.Multithreaded</name>
    <value>true</value>
    <description>Set this to true if multiple threads access metastore through JDO concurrently.</description>
  </property>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:derby:;databaseName=/usr/local/apache-hive-1.2.1-bin/metastore_db;create=true</value>
    <description>JDBC connect string for a JDBC metastore</description>
  </property>

那么它为什么要在/user/hive/warehouse下创建metastore_db呢?

共有1个答案

饶志
2023-03-14

我的问题是我没有将hive-default.xml.template名称更改为hive-site.xml

 类似资料:
  • 我已经使用JDBC api连接到HIVE2,这里提到,它是成功的,所以为了方便访问,我想到创建一个webapp,使用JSP作为前端页面来输入服务器名称和查询。虽然从JSP页面到servlet的所有参数都被正确解析,但它在连接到配置单元服务器时引发了一个错误,这是将libthrift和配置单元JAR放置在WEB-INF/lib目录中的必要条件,我同时放置在WEB-INF/lib和classpath中

  • 我使用下面提到的连接URL连接到蜂巢服务器使用直线。 !连接jdbc: hive2://sandbox.hortonworks.com:21000/default; ssl=true; sslTrustStore=/var/lib/Knox/data-2.3.2.0-2950/Security/keystore/gateway.jks; Trust StorePassword=Knox?hive.

  • 然后我给出一个空白的用户名和密码,并得到以下错误: 有人能帮我接通吗

  • 我试图为我的本地配置单元服务器实例(thrift)创建一个连接和getMataData()。 以下是我正在尝试的代码: 线程“main”java.lang.noClassDefFounderror:org/apache/hadoop/hive/metaexception在org.apache.hadoop.hive.jdbc.hivedriver.connect(Hivedriver.java:1

  • 我使用Hortonworks Hadoop HDP-2.3.2.0-2950 Hive over Tez引擎 下面2个查询来自Java代码。 ——运行良好 ——失败并出现错误 我的代码: