Migrating database configuration to a new location

The operations performed on queues in Queue Manager UI are stored as Queue Manager versions. You can either store these versions in the default database location on the host or configure a new location using Cloudera Manager UI.

By default, Queue Manager stores the operations performed on queues as versions in the config-service.mv.db database file on the host. Alternatively, you can configure a new database file in a new location and migrate the version information to the new file.

For security reasons, if you do not want to allow users to access the default database, you can move the database file to an alternative location. During an upgrade, you can move the database file to some other location and then restore this file to the default location after the upgrade.

  1. (Optional) You can view the version information in the Queue Manager UI that needs to be migrated to a new location.
  2. In Cloudera Manager, click Clusters > queuemanager
  3. Go to the Configuration tab.
  4. Specify the new file location like in Location for config-service DB. The config-service database location should be prefixed with jdbc:h2:. For example: jdbc:h2:~/testDb,jdbc:h2:/var/lib/dbdir/test, and jdbc:h2:/var/lib/***username***/db/config-service.

  5. Click Save Changes.

  6. Click Actions and select Restart.

    After you add the new database location in the Queue Manager service configuration, there will be a similar .mv.db file and .trace.db file in the new location.

  7. SSH into the host machine running the YARN Queue Manager service.
    ssh [***your_username***]@[***queue_manager_host_ip_address***]
  8. Navigate to the directory where the configuration database file is stored.
    cd /var/lib/hadoop-yarn/
  9. Find the default location of the initial database file.
    find / -name  "config-service.mv.db" 
    The complete path to the .db file is displayed.
  10. Replicate the permission at the directory level for the new database location and verify if the database directory level permissions are the same.
  11. Copy the contents of the old file .mv.db file to the new .mv.db file.
    # cp config-service.mv.db new-location-config-service.mv.db 
  12. Type y to overwrite the file.
  13. In Cloudera Manager, click Clusters > queue manager. Click Actions and select Restart to restart the service.

You have now changed the location of the database file. All queue information is now available in the new file and can be viewed from the Queue Manager UI.