Kiran Krishna Innamuri
Kiran Krishna Innamuri

Reputation: 1002

No suitable driver found error while starting hive and spark

When i am trying to start hive or spark i am getting this error.

16/07/13 16:55:12 ERROR Schema: Failed initialising database.
No suitable driver found for jdbc:;derby;databaseName=metastore_db;create=true
org.datanucleus.exceptions.NucleusDataStoreException: No suitable driver found for jdbc:;derby;databaseName=metastore_db;create=true

I am not able to resolve it.Can anyone help?

Upvotes: 0

Views: 863

Answers (1)

Ronak Patel
Ronak Patel

Reputation: 3849

looks like hive lib path is not set in spark-env.sh file. Follow these steps

  • Copy hive-site.xml from HIVE_HOME/conf to SPARK_HOME/conf folder.
  • Add hive lib path to classpath in SPARK_HOME/conf/spark-env.sh
  • Restart the Spark cluster for everything to take effect.

In order to setup mysql as hive metastore hive-site.xml should have these properties setup:

    <property>
     <name>javax.jdo.option.ConnectionURL</name>
     <value>jdbc:mysql://MYSQL_HOST:3306/hive_{version}</value>
     <description>JDBC connect string for a JDBC metastore</description>
    </property>
    <property>
     <name>javax.jdo.option.ConnectionDriverName</name>
     <value>com.mysql.jdbc.Driver</value>
     <description>Driver class name for a JDBC metastore/description>
    </property>
    <property>
     <name>javax.jdo.option.ConnectionUserName</name>
     <value>XXXXXXXX</value>
     <description>Username to use against metastore database/description>
    </property> 
    <property>
     <name>javax.jdo.option.ConnectionPassword</name>
     <value>XXXXXXXX</value>
     <description>Password to use against metastore database/description>
    </property>

if this does not resolve the error, provide more info about steps you follow to install/configure youe environment

Upvotes: 1

Related Questions