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.
- (Optional) You can view the version information in the Queue Manager UI that needs to be migrated to a new location.
In Cloudera Manager, click Clusters > queuemanager .
- Go to the Configuration tab.
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.
Click Save Changes.
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.
- SSH into the host machine running the YARN Queue Manager
- Navigate to the directory where the configuration database file is
- Find the default location of the initial database
The complete path to the .db file is displayed.
find / -name "config-service.mv.db" /var/lib/hadoop-yarn/config-service.mv.db
- Replicate the permission at the directory level for the new database location and verify if the database directory level permissions are the same.
- Copy the contents of the old file .mv.db file to the new
# cp config-service.mv.db new-location-config-service.mv.db
- Type y to overwrite the file.
- 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.