无法在配置单元中示例化metadata.sessionhivemetastoreclient(ubuntu 16.04)

tvmytwxo  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(214)

我正试图在ubuntu16.04上用mysql安装hive2.3.0。我已经安装了hadoop,运行良好。我可以进入配置单元控制台,但是没有执行任何命令,而是出现了一个错误:
semanticexception org.apache.hadoop.hive.ql.metadata.hiveexception:java.lang.runtimeexception:无法示例化org.apache.hadoop.hive.ql.metadata.sessionhivemetastoreclient
这是我的hive-site.xml

<configuration>
<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost/metastore?useSSL=true;</value>
  <description>metadata is stored in a MySQL server</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>MySQL JDBC driver class</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hiveuser</value>
  <description>user name for connecting to mysql server</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hivepassword</value>
  <description>password for connecting to mysql server</description>
</property>
</configuration>

我还使用这个链接在mysql中创建了metastore数据库。
错误图像

iugsix8n

iugsix8n1#

我想出了解决办法。metastore没有示例化的问题是由于mysql中存在重复的键。而不是从mysql中获取配置单元模式。使用此选项: hive --service metastore 我也更新了hive-site.xml:

<configuration>
 <property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost/metastore?useSSL=false</value>
  <description>metadata is stored in a MySQL server</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>MySQL JDBC driver class</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>Username</value>
  <description>user name for connecting to mysql server</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>Password</value>
  <description>password for connecting to mysql server</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>

还要查看完整的堆栈跟踪,请使用schematool: schematool -initSchema -dbType mysql --verbose

相关问题