Backing up ranger_audits Solr collection
Perform a critical pre-upgrade step for Cloudera 7.3.2.0 or higher releases, focusing on the Ranger Audits Solr collection. This includes the process of backing up the existing ranger_audits collection and schema.
When upgrading to Cloudera 7.3.2.0 and higher releases that update the Ranger Audits Solr schema, Cloudera Manager runs an internal service command to apply the schema changes safely.
Although the command is non-destructive, Cloudera strongly recommends creating a backup of the Ranger Audits Solr collection before starting the upgrade. This ensures a quick restoration of audit data if an error occurs during the upgrade.
- The Solr service must be functional and in a running state.
- You must have access to the Solr host, for example, https://<solr-server-host>:<solr-server-port>, where the ranger_audits collection is located.
- You must enable Kerberos authentication, and use the appropriate rangeradmin
principal from the ranger.keytab
file.
ps -ef | grep rangeradmin | awk '{split($0, array,"-cp"); print array[2]}' | cut -d: -f1 #Note down the path for RANGER_ADMIN_CONF_DIR klist -kt <RANGER_ADMIN_CONF_DIR>/../ranger.keytab #Note down RANGER_ADMIN_PRINCIPAL, it must starts with 'rangeradmin' by default kinit -kt <RANGER_ADMIN_CONF_DIR>/../ranger.keytab <RANGER_ADMIN_PRINCIPAL> #No output will be returned on successful authentication - The Ranger user associated with the rangeradmin principal must have adequate permissions defined in the Ranger Solr policy. This is required if the Ranger plugin is enabled, as it allows the execution of Solr REST API operations for tasks such as collection backups and schema updates.
- You must confirm that the Ranger plugin auditing in Solr is working.
- You must have a backup location, with enough space, to store the exported schema JSON file and logs.
Optional. If you encounter any failure during the upgrade, you must restore the Ranger Audits Solr Schema and collection to their previous state. For more information, see Restore Ranger audit Solr schema and collection.
