SOLR-15204: Document bin solr zk and zkcli (#2437)

* Update examples to use bin/solr zk
This commit is contained in:
Eric Pugh 2021-03-03 14:43:01 -05:00 committed by GitHub
parent d822a38a48
commit c974b233e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View File

@ -70,17 +70,23 @@ Here is a more detailed `security.json` example. In this, the Basic authenticati
=== In SolrCloud Mode
While configuring Solr to use an authentication or authorization plugin, you will need to upload a `security.json` file to ZooKeeper. The following command writes the file as it uploads it - you could also upload a file that you have already created locally.
While configuring Solr to use an authentication or authorization plugin, you will need to upload a `security.json` file to ZooKeeper.
[source,bash]
Create the file `security.json` with the contents:
[source,json]
----
>server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd put /security.json
'{"authentication": {"class": "org.apache.solr.security.KerberosPlugin"}}'
{"authentication": {"class": "org.apache.solr.security.KerberosPlugin"}}
----
Note that this example defines the `KerberosPlugin` for authentication. You will want to modify this section as appropriate for the plugin you are using.
This example also defines `security.json` on the command line, but you can also define a file locally and upload it to ZooKeeper.
Then use the `bin/solr zk` command to upload the file:
[source,bash]
----
>bin/solr zk cp ./security.json zk:security.json -z localhost:2181
----
[WARNING]
====

View File

@ -165,13 +165,18 @@ bin/zkServer.sh start -Djava.security.auth.login.config=/etc/zookeeper/conf/jaas
=== Create security.json
Create the `security.json` file.
Create the file `security.json` with the contents:
In SolrCloud mode, you can set up Solr to use the Kerberos plugin by uploading the `security.json` to ZooKeeper while you create it, as follows:
[source,json]
----
{"authentication": {"class": "org.apache.solr.security.KerberosPlugin"}}
----
Then use the `bin/solr zk` command to upload the file:
[source,bash]
----
server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd put /security.json '{"authentication":{"class": "org.apache.solr.security.KerberosPlugin"}}'
>bin/solr zk cp ./security.json zk:security.json -z localhost:2181
----
If you are using Solr in standalone mode, you need to create the `security.json` file and put it in your `$SOLR_HOME` directory.