Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Apache Drill. connecting metastore

avatar
Master Collaborator

Hi:

I cant connect to my HiveMetastore, here the file and the error:

{
  "type": "hive",
  "enabled": true,
  "configProps": {
    "hive.metastore.uris": "",
    "javax.jdo.option.ConnectionURL": "jdbc:mysql://hostname:10000/hive",
    "hive.metastore.warehouse.dir": "/tmp/drill_hive_wh",
    "fs.default.name": "file:///",
    "hive.metastore.sasl.enabled": "false"
  }
}

Error

14:38:42.335 [qtp2051611232-196] ERROR DataNucleus.Datastore.Schema - Failed initialising database.
org.datanucleus.exceptions.NucleusDataStoreException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://lnxbig05.cajarural.gcr:10000/hive, username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
java.sql.SQLException: No suitable driver found for jdbc:mysql://lnxbig05.cajarural.gcr:10000/hive
        at java.sql.DriverManager.getConnection(DriverManager.java:689)

 at sun.reflect.GeneratedConstructorAccessor179.newInstance(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_65]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [na:1.8.0_65]
        at com.jolbox.bonecp.PoolUtil.generateSQLException(PoolUtil.java:192) ~[bonecp-0.8.0.RELEASE.jar:na]
        at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:422) ~[bonecp-0.8.0.RELEASE.jar:na]
        at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120) ~[bonecp-0.8.0.RELEASE.jar:na]
        at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:501) ~[datanucleus-rdbms-3.2.9.jar:na]
        ... 92 common frames omitted
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://lnxbig05.cajarural.gcr:10000/hive
        at java.sql.DriverManager.getConnection(DriverManager.java:689) ~[na:1.8.0_65]
        at java.sql.DriverManager.getConnection(DriverManager.java:208) ~[na:1.8.0_65]
        at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361) ~[bonecp-0.8.0.RELEASE.jar:na]
        at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416) ~[bonecp-0.8.0.RELEASE.jar:na]
        ... 94 common frames omitted





1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hi:

After try alot time is working with this:

{
  "type": "hive",
  "enabled": true,
  "configProps": {
    "hive.metastore.uris": "thrift://hostname_metastore:9083",
    "javax.jdo.option.ConnectionURL": "jdbc:mysql://hostname_metastore/drill",
    "hive.metastore.warehouse.dir": "/tmp/drill_hive_wh",
    "fs.default.name": "hdfs://master_hortonworks:8020",
    "hive.metastore.sasl.enabled": "false"
  }
}

View solution in original post

5 REPLIES 5

avatar
Super Guru
@Roberto Sancho

Did you copied the MySQL driver inside drill/lib?

For MySQL, Drill has been tested with MySQL's mysql-connector-java-5.1.37-bin.jar driver. Copy this to all drill nodes.

avatar
Super Guru

Do you have any hive metastore running in cluster or you want to connect to hive embedded metastore?

avatar
Master Collaborator

Hi:

I have copied it and runned this command and still doestn work.

[root@lnxbig05 lib]# pwd
/opt/apache-drill-1.6.0/lib
[root@lnxbig05 lib]# ls -lrt
total 968
-rw-r--r-- 1 root root 989497 May  4 13:11 mysql-connector-java-5.1.39-bin.jar


script:


[root@lnxbig05 bin]# ./sqlline –u mysql:drill:schema=hiveremote;zk=lnxbig04.cajarural.gcr:2181,lnxbig05.cajarural.gcr:2181,lnxbig06.cajarural.gcr:2181
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
–u (No such file or directory)
mysql:drill:schema=hiveremote (No such file or directory)
apache drill 1.6.0
"drill baby drill"
sqlline>


but i cant see that:

jdbc:drill:schema=hiveremote>

thanks

avatar
Master Collaborator

Hi:

After try alot time is working with this:

{
  "type": "hive",
  "enabled": true,
  "configProps": {
    "hive.metastore.uris": "thrift://hostname_metastore:9083",
    "javax.jdo.option.ConnectionURL": "jdbc:mysql://hostname_metastore/drill",
    "hive.metastore.warehouse.dir": "/tmp/drill_hive_wh",
    "fs.default.name": "hdfs://master_hortonworks:8020",
    "hive.metastore.sasl.enabled": "false"
  }
}

avatar
Super Guru
@Roberto Sancho

Well looks like you are running Hive metastore 🙂