1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Spark2.1から3にしたときのメモ

Last updated at Posted at 2021-04-29

動機

Spark2.1 + Zeppelinで解析基盤を構築してます。UnionByNameとかが使えないので、Spark3.0にアップデートすることにしました。

環境

Apache Hadoop 2.7.3 Apache Spark 2.1 Docker mySQL 5.7.3 (metastore)

課題

ダウンロードして docker start mysqld ${HADOOP_HOME}/sbin/start-dfs.sh ${SPARK_HOME}/sbin/start-all.sh したら、 spark hive Caused by: org.datanucleus.exceptions.NucleusException: Attempt to invoke the "BONECP" plugin to create a ConnectionPool gave an error : The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH

解決

色々調べてとりあえずhive.jarのバージョンがあっていない様子。 https://support.datafabric.hpe.com/s/article/Spark-Hive-Integration-failure?language=ja

hive-site.xmlに

<name>hive.metastore.schema.verification</name>
<value>false</value>

を記載して対処し、とりあえず無事動きました。

<configuration>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://XXXX/metastore_db?createDatabaseIfNotExist=true</value>
        <description>metastore</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>XXXX</value>
        <description>user name for connecting to mysql server </description>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>XXXX</value>
        <description>password for connecting to mysql server </description>
    </property>
    <property>
        <name>hive.metastore.schema.verification</name>
        <value>false</value>
    </property>
    <property>
        <name>hive.metastore.warehouse.dir</name>
        <value>hdfs://XXXX</value>
        <description>location of default database for the warehouse</description>
  </property>
</configuration>
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?