无法启动spark thriftserver(hive-site.xml for spark didn&t; t)覆盖默认值

时间:2016-11-18 07:37:21

标签: mysql apache-spark hive metastore

背景:

  1. CentOS7
  2. 的hadoop-2.7.3
  3. 火花2.0.1彬hadoop2.7
  4. apache-hive-2.1.0-bin(仅用于通过hive启动Metastore服务 - 服务Metastore)
  5. 配置了HADOOP_HOME,SPARK_HOME和HIVE_HOME等
  6. mysql 5.7.16
  7. 已将mysql-connector-java-5.1.40-bin.jar放入hive / lib /和spark / jars /
  8. 蜂房-site.xml中:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    <configuration>
        <property>
            <name>javax.jdo.option.ConnectionURL</name>
            <value>jdbc:mysql://www.test.com:3306/metastore</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionDriverName</name>
            <value>com.mysql.jdbc.Driver</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionUserName</name>
            <value>hive</value>
        </property>
        <property>
            <name>javax.jdo.option.ConnectionPassword</name>
            <value>password</value>
        </property>
        <property>
            <name>hive.metastore.uris</name>
            <value>thrift://www.test.com:9083</value>
        </property>
        <property>
            <name>hive.metastore.schema.verification</name>
            <value>true</value>
        </property>
    </configuration>
    

    我将hive-site.xml放入hive / conf /和spark / conf /

    但是运行start-thriftserver.sh,我得到错误日志(在spark_home / logs / spark- -HiveThriftServer2 .out):

    ......
    INFO HiveUtils: Initializing HiveMetastoreConnection version 1.2.1 using Spark classes.
    INFO metastore: Trying to connect to metastore with URI thrift://www.test.com:9083
    INFO metastore: Connected to metastore.
    ......
    DEBUG ObjectStore: Overriding javax.jdo.option.ConnectionURL value null from  jpox.properties with jdbc:derby:memory:;databaseName=/tmp/spark-37dcab7f-655a-4506-abd7-492a8620a33e/metastore;create=true
    ......
    INFO MetaStoreDirectSql: Using direct SQL, underlying DB is DERBY
    ......
    org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
    

    在日志中我们可以看到属性&#34; hive.metastore.uris&#34;做了。

    但似乎其他mysql相关属性不起作用,Metastore仍然使用默认的数据库derby。

    任何帮助表示赞赏!感谢。

    解决:

    我删除了hive.metastore.uris,因为我刚刚在本地使用了hive。

    &#13;
    &#13;
    <property>
      <name>hive.metastore.uris</name>
      <value>thrift://www.test.com:9083</value>
    </property>
        	
    &#13;
    &#13;
    &#13;

    将hive.metasotre.schema.verification设置为false。感谢Nirmal的帮助。

1 个答案:

答案 0 :(得分:1)

发现此错误日志

Caused by: MetaException(message:Version information not found in metastore

集, 的价值 hive-site.xml中的hive.metastore.schema.verification为false,hive和spark配置并重新启动服务,然后重试