Support Questions

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

Error When Executing Hive-Sample on CDH5.0.1

avatar
Explorer

Hi, 

I am having problem when tried to run samples from Hue WebUI. Was trying to execute Hive-Sample from the UI, and getting the error as below:

 

Kindly seek for help on the issue.

 

Unable to open a test connection to the given database. JDBC url = jdbc:derby:;databaseName=/var/lib/hive/metastore/metastore_db;create=true, username = APP. Terminating connection pool. Original Exception: ------
  java.sql.SQLException: Failed to create database '/var/lib/hive/metastore/metastore_db', see the next exception for details.
  at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
  at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.Driver20.connect(Unknown Source)
  at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
  at java.sql.DriverManager.getConnection(DriverManager.java:571)
  at java.sql.DriverManager.getConnection(DriverManager.java:187)
  at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:254)
  at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:305)
  at com.jolbox.bonecp.BoneCPDataSource.maybeInit(BoneCPDataSource.java:150)
  at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:112)
  at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:479)
  at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:304)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:631)
  at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
  at org.datanucleus.NucleusContext.createStoreManagerForProperties(NucleusContext.java:1069)
  at org.datanucleus.NucleusContext.initialise(NucleusContext.java:359)
  at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:768)
  at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:326)
  at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:195)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
  at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
  at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
  at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
  at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:307)
  at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:336)
  at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:245)
  at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:220)
  at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
  at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
  at org.apache.hadoop.hive.metastore.RetryingRawStore.<init>(RetryingRawStore.java:62)
  at org.apache.hadoop.hive.metastore.RetryingRawStore.getProxy(RetryingRawStore.java:71)
  at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:420)
  at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:407)
  at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:446)
  at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:333)
  at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:293)
  at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:54)
  at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:59)
  at org.apache.hadoop.hive.metastore.HiveMetaStore.newHMSHandler(HiveMetaStore.java:4085)
  at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:126)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1161)
  at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:62)
  at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:72)
  at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2407)
  at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2418)
  at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1141)
  at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1130)
  at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:2250)
  at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:334)
  at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151)
  at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65)
  at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1485)
  at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1263)
  at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1091)
  at org.apache.hadoop.hive.ql.Driver.run(Driver.java:931)
  at org.apache.hadoop.hive.ql.Driver.run(Driver.java:921)
  at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
  at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
  at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:422)
  at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:357)
  at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:455)
  at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:465)
  at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:746)
  at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684)
  at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:623)
  at org.apache.oozie.action.hadoop.HiveMain.runHive(HiveMain.java:315)
  at org.apache.oozie.action.hadoop.HiveMain.run(HiveMain.java:276)
  at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:38)
  at org.apache.oozie.action.hadoop.HiveMain.main(HiveMain.java:66)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:226)
  at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
  at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:430)
  at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
  at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:415)
  at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
  at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
  Caused by: java.sql.SQLException: Failed to create database '/var/lib/hive/metastore/metastore_db', see the next exception for details.
  at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
  ... 102 more
1 ACCEPTED SOLUTION

avatar
Explorer

Hi Romain,

I able to run the Hive sample that came with Huw now. Just need to update the hive-config.xml inside the sample itself, and works now.

 

Thanks..

Sia

View solution in original post

6 REPLIES 6

avatar
Super Guru

avatar
Explorer

Hi Romain,

I was quite confusing about this. I installed CM5 and CDH5.0.1 via parcels. and database I am using is MySQL. Services were installed automatically via the CM wizard.

 

What is the different of setting up Hive service as descibed in document comparing the one setup from Wizard? However, I tried to setup as per the document, but still not working, and with the same errors.

 

Thanks and Regards,

KK 

avatar
Super Guru
I am not sure if CM setups the Metastore with Derby or MySql.

In any case, when using Oozie you need a real DBMS for the Metastore as the
Hive action will run on some nodes and need to contact the Metastore.

Could you share your hive-site.xml and the one you are using in Oozie?
(they could be the same)

Romain

avatar
Explorer

Hi Romain,

I able to run the Hive sample that came with Huw now. Just need to update the hive-config.xml inside the sample itself, and works now.

 

Thanks..

Sia

avatar
Super Guru
Glad to hear!

Romain

avatar
Explorer

Just need to update the hive-config.xml inside the sample itself, and works now.

 

Can you please explain exactly what you did - please assume I am new to this.

 

thank you ...