This topic provides answers to some commonly asked questions about metadata management in EMR.

What do I do if an error indicating that the oss://yourbucket/***/***/*** or hdfs://yourhost:9000/***/***/*** directory is not found is reported?

Cause: The data of a table in OSS has been deleted or moved to another path, but the schema of the table still exists.

Solution: Change the table location to an existing path and delete the table.
alter table test set location 'oss://your_bucket/your_folder'
Note oss://your_bucket/your_folder in the command must be an existing OSS path.

What do I do if the error "java.lang.IllegalArgumentException: *****" is reported when I delete a Hive database?

Cause: A Hive database is created in HDFS of a cluster, and it is not deleted when the cluster is released. As a result, the database cannot be accessed after another cluster is created. When you release a cluster, you must delete the databases and tables that you manually created for the cluster from HDFS.

  1. Log on to the master node of the cluster. Find the URL, username, and password of the Hive database in the $HIVE_CONF_DIR/hivemetastore-site.xml file.
    javax.jdo.option.ConnectionUserName // The username of the database
    javax.jdo.option.ConnectionPassword // The password of the database
    javax.jdo.option.ConnectionURL // The database access URL and database name
  2. On the master node of the cluster, enter the following command and enter the password as prompted to log on to the created Hive database:
    mysql -h ${DBConnectionURL} -u ${ConnectionUserName} -p
  3. Change the value of the DB_LOCATION_URI parameter to an existing OSS path in the region. hive_meta_db

How do I log on to the built-in MySQL service of a cluster?

  1. Log on to the master node of your cluster in SSH mode.

    For more information, see Log on to a cluster.

  2. Run the following command to log on to the built-in MySQL:
    mysql -uroot -pEMRroot1234

    The username that is used to log on to the built-in MySQL is root and the password is EMRroot1234.