无法在windows 10上启动配置单元:在配置单元配置上应用授权策略时出错

8mmmxcuj  于 2021-05-29  发布在  Hadoop
关注(0)|答案(2)|浏览(472)

我正在尝试在Windows10上安装hive。尝试启动配置单元时,我收到以下错误:
对配置单元配置应用授权策略时出错:org.apache.hadoop.hive.ql.metadata.hiveexception:java.lang.runtimeexception:无法示例化org.apache.hadoop.hive.ql.metadata.sessionhivemetastoreclient
我正在使用derby作为hive的后端。这是我的hive-site.xml文件:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:derby://localhost:1527/metastore_db;create=true</value>
    <description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.apache.derby.jdbc.ClientDriver</value>
    <description>Driver class name for a JDBC metastore</description>
</property>
<property>
    <name>hive.server2.enable.impersonation</name>
    <description>Enable user impersonation for HiveServer2</description>
    <value>true</value>
</property>
<property>
    <name>hive.server2.authentication</name>
    <value>NONE</value>
    <description>
      Client authentication types.
        NONE: no authentication check
        LDAP: LDAP/AD based authentication
        KERBEROS: Kerberos/GSSAPI authentication
        CUSTOM: Custom authentication provider
                (Use with property hive.server2.custom.authentication.class)
    </description>
</property>
<property>
    <name>datanucleus.autoCreateTables</name>
    <value>True</value>
</property>
</configuration>

我首先启动networkserver:

d:\Hadoop-2.8.1\sbin>startNetworkServer -h 0.0.0.0
Fri Feb 09 08:57:01 EST 2018 : Security manager installed using the Basic server security policy.
Fri Feb 09 08:57:01 EST 2018 : Apache Derby Network Server - 10.14.1.0 - (1808820) started and ready to accept connections on port 1527

然后运行start-all.cmd:

d:\Hadoop-2.8.1\sbin>start-all.cmd

检查networkservercontrol:

d:\Hadoop-2.8.1\sbin>jps -m
12532 ResourceManager
7156 NetworkServerControl start -h 0.0.0.0
20504 Jps -m
27336 DataNode
22604 NodeManager
492 NameNode

最后,我尝试启动hive,此时收到错误:

d:\Hadoop-2.8.1\sbin>hive

我注意到在配置单元的bin目录中没有创建metastore\u db:

Directory of d:\Hadoop-2.8.1\hive2_1\bin

02/06/2018  01:48 PM    <DIR>          .
02/06/2018  01:48 PM    <DIR>          ..
11/28/2016  04:32 PM             1,261 beeline
11/28/2016  04:32 PM             2,553 beeline.cmd
02/06/2018  01:48 PM    <DIR>          ext
11/28/2016  04:35 PM             8,692 hive
11/28/2016  04:32 PM             1,584 hive-config.cmd
02/09/2018  08:20 AM             1,900 hive-config.sh
11/28/2016  04:32 PM             8,823 hive.cmd
11/28/2016  04:32 PM               885 hiveserver2
11/28/2016  04:32 PM             1,030 hplsql
11/28/2016  04:32 PM             2,278 hplsql.cmd
11/28/2016  04:32 PM               832 metatool
11/28/2016  04:32 PM               884 schematool
              11 File(s)         30,722 bytes
               3 Dir(s)  427,455,606,784 bytes free

有人知道我哪里出错了吗?

5uzkadbs

5uzkadbs1#

对我来说,我必须更改hive-site.xml中的这一行,而不是使用localhost:1527

jdbc:derby:,databaseName=$HIVE_HOME/metastore_db;create=true

在hive-site.xml中还添加了以下两个属性

<property>
<name>hive.downloaded.resources.dir</name>
<value>c:/tmp/hive/${hive.session.id}_resources</value>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
v440hwme

v440hwme2#

我和你有同样的问题。
我使用:
1hadoop-2.7.6版本
2德比-10.12.1.1
三。Hive-2.1.0
这是我的hive-site.xml文件:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:derby://localhost:1527/metastore_db;create=true</value>
        <description>JDBC connect string for a JDBC metastore</description>
    </property>

    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>org.apache.derby.jdbc.ClientDriver</value>
        <description>Driver class name for a JDBC metastore</description>
    </property>

    <property>
        <name>hive.server2.enable.impersonation</name>
        <description>Enable user impersonation for HiveServer2</description>
        <value>true</value>
    </property>

    <property>
        <name>hive.server2.authentication</name>
        <value>NONE</value>
        <description>
            Client authentication types.
              NONE: no authentication check
              LDAP: LDAP/AD based authentication
              KERBEROS: Kerberos/GSSAPI authentication
              CUSTOM: Custom authentication provider (Use with property hive.server2.custom.authentication.class)
        </description>
    </property>

    <property>
        <name>datanucleus.autoCreateSchema</name>
        <value>true</value>
    </property>

    <property>
        <name>datanucleus.fixedDatastore</name>
        <value>true</value>
    </property>

    <property>
        <name>datanucleus.autoCreateTables</name>
        <value>True</value>
    </property>

    <property>
        <name>datanucleus.autoCreateTables</name>
        <value>True</value>
    </property>
</configuration>

以下是我所做的步骤:
创建一个目录,比如说c驱动器中的“testhive”

C:\TestHive

运行start-all.cmd

C:\Users\{YOUR_PC-NAME}\start-all

切换到“testhive”目录

C:\Users\{YOUR_PC-NAME}\cd C:\TestHive

在“testhive”目录中启动startnetworkserver-h0.0.0.0

C:\TestHive\startNetworkServer -h 0.0.0.0

检查networkservercontrol

C:\TestHive>jps -m  
11012 Jps -m  
6196 DataNode  
9284 NetworkServerControl start -h 0.0.0.0  
7544 NameNode  
10092 NodeManager  
316 ResourceManager

在“testhive”目录中启动hive.cmd

C:\TestHive>hive

最后,我得到的结果是:

C:\TestHive>hive  
ERROR StatusLogger No log4j2 configuration file found. Using default configurati  
on: logging only errors to the console.  
Connecting to jdbc:hive2://  
SLF4J: Class path contains multiple SLF4J bindings.  
SLF4J: Found binding in [jar:file:/D:/hive-2.1.0/lib/log4j-slf4j-impl-2.4.1.jar!  
/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: Found binding in [jar:file:/D:/hadoop-2.7.6/share/hadoop/common/lib/slf4j  
-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]  
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.  

SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]  
Connected to: Apache Hive (version 2.1.0)  
Driver: Hive JDBC (version 2.1.0)  
Transaction isolation: TRANSACTION_REPEATABLE_READ  
Beeline version 2.1.0 by Apache Hive  
hive>

这是“testhive”目录的内容:

Directory of C:\TestHive

10/05/2018  16:37    <DIR>          .
10/05/2018  16:37    <DIR>          ..
10/05/2018  16:37               757 derby.log
10/05/2018  16:37    <DIR>          metastore_db
               1 File(s)            757 bytes
               3 Dir(s)  22.890.254.336 bytes free

注意:我假设您已在windows的环境变量中正确设置了所有变量和路径,并以管理员身份运行cmd
希望这能帮你解决问题。

相关问题