Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

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

Eric Pughc974b233e486
diff --git a/solr/solr-ref-guide/src/authentication-and-authorization-plugins.adoc b/solr/solr-ref-guide/src/authentication-and-authorization-plugins.adoc
index df1edde5482..5b237c69918 100644
--- a/solr/solr-ref-guide/src/authentication-and-authorization-plugins.adoc
+++ b/solr/solr-ref-guide/src/authentication-and-authorization-plugins.adoc
@@ -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]
====
diff --git a/solr/solr-ref-guide/src/kerberos-authentication-plugin.adoc b/solr/solr-ref-guide/src/kerberos-authentication-plugin.adoc
index 428898b2a3c..bbfde5ed5f1 100644
--- a/solr/solr-ref-guide/src/kerberos-authentication-plugin.adoc
+++ b/solr/solr-ref-guide/src/kerberos-authentication-plugin.adoc
@@ -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.