Reputation: 177
I am trying to disable the configApi in solr and i read it in a blog stating that "Disable the ConfigAPI if not in use, by running Solr with the system property disable.configEdit=true" .Can someone please explain a little bit on how actually we do it ?
Upvotes: 2
Views: 1986
Reputation: 191
Adding the below line in solr.in.cmd and restarting SOLR worked for me,
set SOLR_OPTS=%SOLR_OPTS% -Ddisable.configEdit=true
We could also validate if the Config API is disabled by executing the following curl command which should result in 403 Forbidden Error,
curl https://localhost:8983/solr/<core_name>/config -H "Accept: application/json" -H "Content-type:application/json" -d "{'set-user-property' : {'variable_name':'some_value'}}"
Upvotes: 0
Reputation: 52802
You set system properties in the Solr startup file. There's usually a parameter named SOLR_OPTS
, where you can add -Ddisable.configEdit=true
. You should also be able to set this in the shell before starting solr with export SOLR_OPTS=....
.
To preserve any values coming from the shell, you should use SOLR_OPTS="$SOLR_OPTS -Ddisable.configEdit=true"
when editing the Solr startup file.
From the example solr.in.sh bundled with Solr:
# Anything you add to the SOLR_OPTS variable will be included in the java
# start command line as-is, in ADDITION to other options. If you specify the
# -a option on start script, those options will be appended as well. Examples:
#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
Upvotes: 6