Skip to main content
ahallam
Gold ⭐️
March 9, 2018

Infra solr optimisation

  • October 5, 2026 at 9:12 AM
  • 0 replies
  • 1947 views
  • Translate All

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