Last active
April 6, 2017 23:19
-
-
Save shawnfeldman/8cd471ba95251404973a5eba42523b57 to your computer and use it in GitHub Desktop.
Configure basic auth for solr cloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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