diff --git a/solr/bin/solr b/solr/bin/solr index 0ad6b8abcc5..d3624c6badc 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -1165,7 +1165,7 @@ if [[ "$SCRIPT_CMD" == "auth" ]]; then fi done fi - run_tool auth "${AUTH_PARAMS[@]}" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:${AUTH_PORT:-8983}/solr" -authConfDir "$SOLR_HOME" $VERBOSE + run_tool auth "${AUTH_PARAMS[@]}" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:${AUTH_PORT:-8983}" -authConfDir "$SOLR_HOME" $VERBOSE exit $? fi diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 124ef286c14..1c604988c12 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -1640,7 +1640,7 @@ if "!AUTH_PORT!"=="" ( -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ org.apache.solr.cli.SolrCLI auth %AUTH_PARAMS% -solrIncludeFile "%SOLR_INCLUDE%" -authConfDir "%SOLR_HOME%" ^ - -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!AUTH_PORT!/solr + -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!AUTH_PORT! goto done diff --git a/solr/packaging/test/test_auth.bats b/solr/packaging/test/test_auth.bats index 99a6480a59f..0de3786c35e 100644 --- a/solr/packaging/test/test_auth.bats +++ b/solr/packaging/test/test_auth.bats @@ -34,3 +34,17 @@ setup() { run ! solr auth enable -type basicAuth -credentials any:any -updateIncludeFileOnly ture assert_output --partial "Argument [updateIncludeFileOnly] must be either true or false, but was [ture]" } + +@test "auth enable/disable lifecycle" { + solr start -c + solr auth enable -type basicAuth -credentials name:password + solr assert --started http://localhost:${SOLR_PORT}/solr --timeout 5000 + + run curl -u name:password --basic "http://localhost:${SOLR_PORT}/solr/admin/collections?action=CREATE&collection.configName=_default&name=test&numShards=2&replicationFactor=1&router.name=compositeId&wt=json" + assert_output --partial '"status":0' + + solr auth disable + run curl "http://localhost:${SOLR_PORT}/solr/test/select?q=*:*" + assert_output --partial '"numFound":0' + solr stop -all +} diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc index d292ed27e2c..f4fed20ae77 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc @@ -324,7 +324,7 @@ For example, if Solr is running on port 8983, then the embedded ZooKeeper will l [IMPORTANT] ==== If your ZooKeeper connection string uses a chroot, such as `localhost:2181/solr`, then you need to create the /solr znode before launching SolrCloud using the `bin/solr` script. -+ + To do this use the `mkroot` command outlined below, for example: `bin/solr zk mkroot /solr -z 192.168.1.4:2181` ====