Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (2)
avatar
Contributor

Below steps are for taking backup of ranger audits and then restore them back to new collection which will be using updated manage-schema fix given in RANGER-1938.

Note: Steps are only for Solr version 5.x and Ranger service managed by Ambari.


1) Backup existing ranger_audits collection:

curl -X GET "http://${SOLR_HOST}:${SOLR_PORT}/solr/ranger_audits/replication?command=backup&location=/tmp"

2) Download existing managed-schema from Zookeeper:

/usr/lib/ambari-infra-solr/server/scripts/cloud-scripts/zkcli.sh --zkhost "${ZK_HOST}:${ZK_PORT}/${SOLR_ZNODE}" -cmd getfile /configs/ranger_audits/managed-schema /tmp/managed-schema

3) Upload updated managed-schema given here to Zookeeper:

/usr/lib/ambari-infra-solr/server/scripts/cloud-scripts/zkcli.sh --zkhost "${ZK_HOST}:${ZK_PORT}/${SOLR_ZNODE}" -cmd putfile /configs/ranger_audits/managed-schema managed-schema

4) Delete existing ranger_audits collection:

curl -i "http://${SOLR_HOST}:${SOLR_PORT}/solr/admin/collections?action=DELETE&name=ranger_audits"

5) Update max retention days(ranger_audit_max_retention_days) config value in Advanced ranger-solr-configuration to 21 and Restart Ranger Service.

6) Restore ranger_audits collection backup to newly created collection:

curl -X POST "http://${SOLR_HOST}:${SOLR_PORT}/solr/ranger_audits/replication?command=restore&location=/tmp"

7) To check the status of restore:

curl http://${SOLR_HOST}:${SOLR_PORT}/solr/ranger_audits/replication?command=restorestatus
4,527 Views
Comments
avatar
Contributor

@mvaradkar Very good article :). Can you also check the code which might not work when kerberos authentication is enable for infra-solr.

Version history
Last update:
‎01-03-2018 07:11 AM
Updated by:
Contributors