Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Rising Star

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/solrCloudCli.sh --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/zkcli.sh --zkhost XXXXXX:2181 -cmd getfile /infra-solr/configs/ranger_audits/solrconfig.xml /tmp/solrconfig.xml


3) Restart Infra

415 Views
0 Kudos
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎03-09-2018 02:07 PM
Updated by:
 
Contributors
Top Kudoed Authors