Community Articles

Find and share helpful community-sourced technical articles.
Celebrating as our community reaches 100,000 members! Thank you!
Expert Contributor

Quick tips to optimise your infra Solr for Ranger audits using SolrCloud.

1) Change the SolrCloud retention period of the audit.
On the server of ranger under : /usr/hdp/current/ranger-admin/contrib/solr_for_audit_setup/conf

#### Edit the file or use sed to replace the 90 Days in the solrconfig.xml , choose the right retention period, here is 6 hours

sed -i 's/+90DAYS/+6HOURS/g' solrconfig.xml 

sed -i 's/86400/7200/g' solrconfig.xml

2) Change ZK config, by submitting the xml again

/usr/lib/ambari-infra-solr-client/ --zookeeper-connect-string XXXXXX:2181/infra-solr --upload-config --config-dir /usr/hdp/current/ranger-admin/contrib/solr_for_audit_setup/conf --config-set ranger_audits  --jaas-file /usr/hdp/current/ranger-admin/conf/ranger_solr_jaas.conf

Check that we loaded it correctly, in the Solr UI or with the following command

#Download the solrconfig.xml from Zookeeper

/usr/lib/ambari-infra-solr/server/scripts/cloud-scripts/ --zkhost XXXXXX:2181 -cmd getfile /infra-solr/configs/ranger_audits/solrconfig.xml /tmp/solrconfig.xml

3) Restart Infra

0 Kudos