Skip to content

Instantly share code, notes, and snippets.

@shawnfeldman
Last active April 6, 2017 23:19
Show Gist options
  • Select an option

  • Save shawnfeldman/8cd471ba95251404973a5eba42523b57 to your computer and use it in GitHub Desktop.

Select an option

Save shawnfeldman/8cd471ba95251404973a5eba42523b57 to your computer and use it in GitHub Desktop.
Configure basic auth for solr cloud
#How to configure solr basic auth to solr cloud
# add basic auth creds
/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost #{zookeepers_string} -cmd put /security.json '{"authentication": {"class": "solr.BasicAuthPlugin","blockUnknown": false,"credentials": {"solr": "IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}},"authorization": {"class": "solr.RuleBasedAuthorizationPlugin","permissions": [{"name": "security-edit","role": "admin"}],"user-role": {"solr": "admin"}}}'
# change the pwd
curl --insecure -v #{solr_scheme}://solr:SolrRocks@localhost:#{solr_port}/solr/admin/authentication -H 'Content-type:application/json' -d "{ 'set-user': {'#{solr_user}': '#{solr_password}'}}"
# enforce auth
curl --insecure -v #{solr_scheme}://#{solr_user}:#{solr_password}@localhost:#{solr_port}/solr/admin/authentication -H 'Content-type:application/json' -d "{'set-property': {'blockUnknown':true}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment