我正在安装hadoop-2.8.0的mac操作系统上的hive-2.1.1。我听从了老师的指示https://dtflaneur.wordpress.com/2015/10/04/installing-hive-on-osx-el-capitan/ 安装Hive。我可以做前5步没有错误。我将hive-site.xml配置为
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hiveuser</value>
<description>Username to use against metastore database </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.ConnectionURL</name>
<value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=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>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>hiveuser</value>
<description>Username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>welcome1</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>datanucleus.fixedDatastore</name>
<value>true</value>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/tmp/hive</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/tmp/hive</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
<property>
<name>hive.querylog.location</name>
<value>/tmp/hive</value>
<description>Location of Hive run time structured log file</description>
</property>
运行$hive时,出现错误:无法示例化org.apache.hadoop.hive.ql.metadata.sessionhivemetastoreclient。完整错误如下所示。我尝试通过以下方式授予特权:
<code>
GRANT ALL PRIVILEGES ON*.* TO 'hiveuser'@'%' Identified by 'welcome1';
GRANT ALL PRIVILEGES ON*.* TO 'hiveuser'@'localhost' Identified by 'welcome1';
GRANT ALL PRIVILEGES ON*.* TO 'hiveuser'@'127.0.0.1' Identified by 'welcome1';
</code>
使用mysql用户“root”
mysql> CREATE DATABASE metastore;
mysql> USE metastore;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,ALTER,CREATE ON metastore.* TO 'root'@'localhost';
并相应地将hive-site.xml文件中的connectionusername更改为root,connectionpassword更改为welcome1。我发布的hive-site.xml文件就是我将用户名改回hiveuser的文件。因为当我把user改成root时,它仍然不起作用。
请帮我解决!提前多谢了!
1条答案
按热度按时间utugiqy61#
错误在此处发布:slf4j:类路径包含多个slf4j绑定。slf4j:在中找到绑定[jar:file:/usr/local/cell/hive/2.1.1/libexec/lib/log4j-slf4j-impl-2.4.1.jar/org/slf4j/impl/staticloggerbinder.class]slf4j:在中找到绑定[jar:file:/usr/local/cell/hadoop/2.8.0/libexec/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar/org/slf4j/impl/staticloggerbinder.class]slf4j:请参阅http://www.slf4j.org/codes.html#multiple_bindings 为了解释。slf4j:实际绑定的类型为[org.apache.logging.slf4j.log4jloggerfactory]