Support Questions
Find answers, ask questions, and share your expertise

Hive - AlreadyExistsException(message:Database cloudera_manager_metastore_canary_test_db_hive

Hive - AlreadyExistsException(message:Database cloudera_manager_metastore_canary_test_db_hive


Could you please suggest why and how should i resolve the below error



[pool-4-thread-3]: AlreadyExistsException(message:Database cloudera_manager_metastore_canary_test_db_hive_HIVEMETASTORE_eab3ee7a2ef37229bc56436ae1121ac2 already exists)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_database(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(
at com.sun.proxy.$Proxy8.create_database(Unknown Source)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$create_database.getResult(
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$create_database.getResult(
at org.apache.thrift.ProcessFunction.process(
at org.apache.thrift.TBaseProcessor.process(
at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor$
at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor$
at Method)
at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor.process(
at org.apache.thrift.server.TThreadPoolServer$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$


Re: Hive - AlreadyExistsException(message:Database cloudera_manager_metastore_canary_test_db_hive


Adding to the above, below is the Advice i get from cloudera manager .


Please advice is to what's the best approach :



This is a Hive Metastore health test that checks that a client can connect and perform basic operations. The operations include: (1) creating a database, (2) creating a table within that database with several types of columns and two partition keys, (3) creating a number of partitions, and (4) dropping both the table and the database. The database is created under the /user/hue/.cloudera_manager_hive_metastore_canary/<Hive Metastore role name>/ and is named "cloudera_manager_metastore_canary_test_db". The test returns "Bad" health if any of these operations fail. The test returns "Concerning" health if an unknown failure happens.

The canary publishes a metric 'canary_duration' for the time it took for the canary to complete. Here is an example of a trigger, defined for the Hive Metastore role configuration group, that changes the health to "Bad" when the duration of the canary is longer than 5 sec: "IF (SELECT canary_duration WHERE entityName=$ROLENAME AND category = ROLE and last(canary_duration) > 5s) DO health:bad"

A failure of this health test may indicate that the Hive Metastore is failing basic operations. Check the logs of the Hive Metastore and the Cloudera Manager Service Monitor for more details.

This test can be enabled or disabled using the Hive Metastore Canary Health Test Hive Metastore monitoring setting.