zoukankan      html  css  js  c++  java
  • spark连接hive出现错误,javax.jdo.JDODataStoreException: Required table missing : "`DBS`" in Catalog "" Schema ""

    今天入门spark,连接hive时一直报错,错误如下

    21/12/12 19:55:26 ERROR Hive: Cannot initialize metastore due to autoCreate error
    javax.jdo.JDODataStoreException: Required table missing : "`DBS`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables"
    Exception in thread "main" org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql));

    看后面黄色字体,我先去初始化元数据了,在我上篇博客上有写,后来发现不是元数据的问题,是需要开启 datanucleus.schema.autoCreateTables

    <property>
        <name>datanucleus.schema.autoCreateAll</name>
        <value>true</value>
     </property>

    完整的 hive-site.xm:

    <configuration>
        <!-- Hive产生的元数据存放位置-->
    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>/user/hive/warehouse</value>
    </property>
        <!--- 使用本地服务连接Hive,默认为true-->
    <property>
        <name>hive.metastore.local</name>
        <value>true</value>
    </property>
    
        <!-- 数据库连接JDBC的URL地址-->
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&amp;useSSL=false&amp;serverTimezone=UTC</value>
    </property>
        <!-- 数据库连接driver,即MySQL驱动-->
    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>com.mysql.jdbc.Driver</value>
    </property>
        <!-- MySQL数据库用户名-->
    <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>root</value>
    </property>
        <!-- MySQL数据库密码-->
    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>123456</value>
     </property>
    <property>
        <name>hive.metastore.schema.verification</name>
        <value>false</value>
     </property>
    <property>
        <name>datanucleus.schema.autoCreateAll</name>
        <value>true</value>
     </property>
    </configuration>
  • 相关阅读:
    rabbitMQ rabbitmq-server -detached rabbitmq-server -detached rabbitmq-server -detached
    ElasticSearch 深度分页解决方案 {"index":{"number_of_replicas":0}}
    git 服务器新建仓库 远程仓库
    mongo 记得开启验证 auth = true
    虚拟机创建及安装ELK
    JSF action actionListner 详解
    Developing JSF applications with Spring Boot
    从问题看本质: 研究TCP close_wait的内幕
    linux server 产生大量 Too many open files CLOSE_WAIT激增
    wildfly tomcat 服务器不响应 不返回 死住了 查看tcp CLOSE_WAIT 暴多
  • 原文地址:https://www.cnblogs.com/LEPENGYANG/p/15680514.html
Copyright © 2011-2022 走看看