Support Questions

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

Cannot connect to hive metastore in tutorial

avatar

I am trying to go through the tutorial with the Cloudera QuickStart VM.

 

However, it fails at the first command:

 

sqoop import-all-tables -m 1 --connect jdbc:mysql://quickstart:3306/retail_db --username=retail_dba --password=cloudera --compression-codec=snappy --as-parquetfile --warehouse-dir=/user/hive/warehouse --hive-import

 

16/01/23 18:27:19 INFO hive.metastore: Waiting 1 seconds before next connection attempt.
16/01/23 18:27:20 INFO hive.metastore: Trying to connect to metastore with URI thrift://quickstart.cloudera:9083
16/01/23 18:27:20 WARN hive.metastore: Failed to connect to the MetaStore Server...
16/01/23 18:27:20 INFO hive.metastore: Waiting 1 seconds before next connection attempt.
16/01/23 18:27:21 ERROR sqoop.Sqoop: Got exception running Sqoop: org.kitesdk.data.DatasetOperationException: Hive metastore exception

 

Do I need to configure something in Hive before running that command?

1 ACCEPTED SOLUTION

avatar

Welp it turns out that hive metastore is a service that needs to be running.  Leaving this in case it helps anyone else.

View solution in original post

6 REPLIES 6

avatar

Welp it turns out that hive metastore is a service that needs to be running.  Leaving this in case it helps anyone else.

avatar
Community Manager

Don't take it so hard. Sometimes the simple things just don't come to mind. Feel free to mark your last comment as the solution so others can find it easier. 🙂


Cy Jervis, Manager, Community Program
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
New Contributor

I had this problem as well, then started Hive via Hue and tried again. I recieved a similar error but also noticed a critical error via the Hue console... "Hive Metastore Canary". Rather cryptic, but I'm willing to bet it's because I'm running in a VM that doesn't really have enough RAM. I only have 8GB on my PC with 5GB allocated to the VM. I searched for pre-built AWS EC2 images I could just spin up quickly but didn't have any luck. Ideas?

 

16/02/10 17:42:17 INFO hive.metastore: Connected to metastore.
16/02/10 17:42:17 ERROR sqoop.Sqoop: Got exception running Sqoop: org.kitesdk.data.DatasetOperationException: Hive MetaStore exception
org.kitesdk.data.DatasetOperationException: Hive MetaStore exception
at org.kitesdk.data.spi.hive.MetaStoreUtil.createTable(MetaStoreUtil.java:252)
at org.kitesdk.data.spi.hive.HiveManagedMetadataProvider.create(HiveManagedMetadataProvider.java:87)
at org.kitesdk.data.spi.hive.HiveManagedDatasetRepository.create(HiveManagedDatasetRepository.java:81)
at org.kitesdk.data.Datasets.create(Datasets.java:239)
at org.kitesdk.data.Datasets.create(Datasets.java:307)
at org.apache.sqoop.mapreduce.ParquetJob.createDataset(ParquetJob.java:141)
at org.apache.sqoop.mapreduce.ParquetJob.configureImportJob(ParquetJob.java:119)
at org.apache.sqoop.mapreduce.DataDrivenImportJob.configureMapper(DataDrivenImportJob.java:130)
at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:260)
at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:673)
at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:118)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:497)
at org.apache.sqoop.tool.ImportAllTablesTool.run(ImportAllTablesTool.java:111)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
Caused by: MetaException(message:Got exception: java.net.ConnectException Call From quickstart.cloudera/127.0.0.1 to quickstart.cloudera:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result$create_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:29897)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result$create_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:29865)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result.read(ThriftHiveMetastore.java:29791)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_create_table_with_environment_context(ThriftHiveMetastore.java:1071)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.create_table_with_environment_context(ThriftHiveMetastore.java:1057)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table_with_environment_context(HiveMetaStoreClient.java:2034)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:670)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:658)
at org.kitesdk.data.spi.hive.MetaStoreUtil$4.call(MetaStoreUtil.java:230)
at org.kitesdk.data.spi.hive.MetaStoreUtil$4.call(MetaStoreUtil.java:227)
at org.kitesdk.data.spi.hive.MetaStoreUtil.doWithRetry(MetaStoreUtil.java:70)
at org.kitesdk.data.spi.hive.MetaStoreUtil.createTable(MetaStoreUtil.java:242)
... 18 more

avatar
New Contributor

you forgot to  start the hive-metastore service.

 

[cloudera@quickstart ~]$ sudo su

[root@quickstart cloudera]# service hive-metastore start

Starting Hive Metastore (hive-metastore):                  [  OK  ]

avatar
New Contributor
This worked for me, thank you! I like it when it's simple stuff.

avatar
Explorer

it is not working for me...