按照CDH时创建 Hive Metastore 数据库表失败。

安装CDH时,创建 Hive Metastore 数据库表失败:

hive/hive.sh ["create_metastore_tables"]
++ false
++ exec /opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hadoop/bin/hadoop jar /opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hive/lib/hive-cli-1.1.0-cdh5.14.0.jar org.apache.hive.beeline.HiveSchemaTool -verbose -dbType mysql -initSchema
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
    at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:79)
    at org.apache.hive.beeline.HiveSchemaTool.getConnectionToMetastore(HiveSchemaTool.java:143)
    at org.apache.hive.beeline.HiveSchemaTool.testConnectionToMetastore(HiveSchemaTool.java:450)
    at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:556)
    at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:542)
    at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:70)
    ... 11 more
*** schemaTool failed ***

前8个组件的数据表都创建成功了,就是hive遇到了问题。

阅读 5.4k
评论
    1 个回答
    • 203

    其实就是驱动的问题,前8个组件都没有用到数据库。
    按照官方文档,如下操作,解决问题。

    sudo cp mysql-connector-java-5.1.31/mysql-connector-java-5.1.31-bin.jar /usr/share/java/mysql-connector-java.jar

    参考链接 Installing the MySQL JDBC Driver for MariaDB

      撰写回答

      登录后参与交流、获取后续更新提醒

      相似问题
      推荐文章