Apache Solr open-source search software
SOLR-14115: Remove deprecated zkcli script. (#2427)
Eric Pughf1fc03fee039
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 816b634052a..01c7e6efab8 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -63,6 +63,9 @@ Deprecation Removalsin favor of the new CompletableFuture based methods. Remove the related deprecated interfaces `AsyncListener` and ``Cancellable`(James Dyer)+* SOLR-14115: Remove deprecated zkcli script in favour of equivalent bin/solr sub commmands. (Eric Pugh)++Dependency Upgrades---------------------(No changes)diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.javadeleted file mode 100644index 856ef68581e..00000000000--- a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java+++ /dev/null@@ -1,526 +0,0 @@-/*- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */-package org.apache.solr.cloud;--import static org.apache.solr.common.params.CommonParams.NAME;-import static org.apache.solr.common.params.CommonParams.VALUE_LONG;--import com.google.common.annotations.VisibleForTesting;-import java.io.File;-import java.io.IOException;-import java.io.PrintStream;-import java.lang.reflect.InvocationTargetException;-import java.nio.charset.StandardCharsets;-import java.nio.file.Files;-import java.nio.file.Path;-import java.nio.file.Paths;-import java.util.List;-import java.util.Properties;-import java.util.concurrent.TimeUnit;-import java.util.concurrent.TimeoutException;-import java.util.regex.Pattern;-import javax.xml.parsers.ParserConfigurationException;-import org.apache.commons.cli.CommandLine;-import org.apache.commons.cli.CommandLineParser;-import org.apache.commons.cli.HelpFormatter;-import org.apache.commons.cli.Option;-import org.apache.commons.cli.Options;-import org.apache.commons.cli.ParseException;-import org.apache.commons.cli.PosixParser;-import org.apache.solr.cli.CLIO;-import org.apache.solr.client.solrj.impl.SolrZkClientTimeout;-import org.apache.solr.common.SolrException;-import org.apache.solr.common.cloud.ClusterProperties;-import org.apache.solr.common.cloud.SolrZkClient;-import org.apache.solr.common.cloud.ZkMaintenanceUtils;-import org.apache.solr.common.util.Compressor;-import org.apache.solr.common.util.StrUtils;-import org.apache.solr.common.util.ZLibCompressor;-import org.apache.solr.core.ConfigSetService;-import org.apache.solr.core.CoreContainer;-import org.apache.solr.core.NodeConfig;-import org.apache.solr.core.SolrXmlConfig;-import org.apache.zookeeper.CreateMode;-import org.apache.zookeeper.KeeperException;-import org.xml.sax.SAXException;--public class ZkCLI implements CLIO {-- private static final String MAKEPATH = "makepath";- private static final String PUT = "put";- private static final String PUT_FILE = "putfile";- private static final String GET = "get";- private static final String GET_FILE = "getfile";- private static final String DOWNCONFIG = "downconfig";- private static final String ZK_CLI_NAME = "ZkCLI";- private static final String HELP = "help";- private static final String LINKCONFIG = "linkconfig";- private static final String CONFDIR = "confdir";- private static final String CONFNAME = "confname";- private static final String ZKHOST = "zkhost";- private static final String RUNZK = "runzk";- private static final String SOLRHOME = "solrhome";- private static final String BOOTSTRAP = "bootstrap";- static final String UPCONFIG = "upconfig";- static final String EXCLUDE_REGEX_SHORT = "x";- static final String EXCLUDE_REGEX = "excluderegex";- static final String EXCLUDE_REGEX_DEFAULT = ConfigSetService.UPLOAD_FILENAME_EXCLUDE_REGEX;- private static final String COLLECTION = "collection";- private static final String CLEAR = "clear";- private static final String LIST = "list";- private static final String LS = "ls";- private static final String CMD = "cmd";- private static final String CLUSTERPROP = "clusterprop";- private static final String UPDATEACLS = "updateacls";- private static final String VERBOSE = "verbose";-- @VisibleForTesting- public static void setStdout(PrintStream stdout) {- ZkCLI.stdout = stdout;- }-- private static PrintStream stdout = CLIO.getOutStream();-- /**- * Allows you to perform a variety of zookeeper related tasks, such as:- *- * <p>Bootstrap the current configs for all collections in solr.xml.- *- * <p>Upload a named config set from a given directory.- *- * <p>Link a named config set explicity to a collection.- *- * <p>Clear ZooKeeper info.- *- * <p>If you also pass a solrPort, it will be used to start an embedded zk useful for single- * machine, multi node tests.- */- public static void main(String[] args)- throws InterruptedException,- TimeoutException,- IOException,- ParserConfigurationException,- SAXException,- KeeperException {-- CommandLineParser parser = new PosixParser();- Options options = new Options();- options.addOption(- Option.builder(CMD)- .hasArg(true)- .desc(- "cmd to run: "- + BOOTSTRAP- + ", "- + UPCONFIG- + ", "- + DOWNCONFIG- + ", "- + LINKCONFIG- + ", "- + MAKEPATH- + ", "- + PUT- + ", "- + PUT_FILE- + ","- + GET- + ","- + GET_FILE- + ", "- + LIST- + ", "- + CLEAR- + ", "- + UPDATEACLS- + ", "- + LS)- .build());-- Option zkHostOption = new Option("z", ZKHOST, true, "ZooKeeper host address");- options.addOption(zkHostOption);- Option solrHomeOption =- new Option("s", SOLRHOME, true, "for " + BOOTSTRAP + ", " + RUNZK + ": solrhome location");- options.addOption(solrHomeOption);-- options.addOption(- "d", CONFDIR, true, "for " + UPCONFIG + ": a directory of configuration files");- options.addOption(- "n", CONFNAME, true, "for " + UPCONFIG + ", " + LINKCONFIG + ": name of the config set");-- options.addOption("c", COLLECTION, true, "for " + LINKCONFIG + ": name of the collection");-- options.addOption(- EXCLUDE_REGEX_SHORT,- EXCLUDE_REGEX,- true,- "for " + UPCONFIG + ": files matching this regular expression won't be uploaded");-- options.addOption(- "r",- RUNZK,- true,- "run zk internally by passing the solr run port - only for clusters on one machine (tests, dev)");-- options.addOption("h", HELP, false, "bring up this help page");- options.addOption(NAME, true, "name of the cluster property to set");- options.addOption(VALUE_LONG, true, "value of the cluster to set");- options.addOption("v", VERBOSE, false, "enable verbose mode");-- try {- // parse the command line arguments- CommandLine line = parser.parse(options, args);-- if ((line.hasOption(HELP) || !line.hasOption(ZKHOST) || !line.hasOption(CMD))- && !line.hasOption(VERBOSE)) {- // automatically generate the help statement- HelpFormatter formatter = new HelpFormatter();- formatter.printHelp(ZK_CLI_NAME, options);- stdout.println("Examples:");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd " + BOOTSTRAP + " -" + SOLRHOME + " /opt/solr");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd "- + UPCONFIG- + " -"- + CONFDIR- + " /opt/solr/collection1/conf"- + " -"- + CONFNAME- + " myconf");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd "- + DOWNCONFIG- + " -"- + CONFDIR- + " /opt/solr/collection1/conf"- + " -"- + CONFNAME- + " myconf");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd "- + LINKCONFIG- + " -"- + COLLECTION- + " collection1"- + " -"- + CONFNAME- + " myconf");- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + MAKEPATH + " /apache/solr");- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + PUT + " /solr.conf 'conf data'");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd "- + PUT_FILE- + " /clusterprops.json /User/myuser/solr/clusterprops.json");- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + GET + " /clusterprops.json");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd "- + GET_FILE- + " /clusterprops.json clusterprops.json");- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + CLEAR + " /solr");- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + LIST);- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + LS + " /solr/live_nodes");- stdout.println(- "zkcli.sh -zkhost localhost:9983 -cmd "- + CLUSTERPROP- + " -"- + NAME- + " urlScheme -"- + VALUE_LONG- + " https");- stdout.println("zkcli.sh -zkhost localhost:9983 -cmd " + UPDATEACLS + " /solr");- return;- }-- // start up a tmp zk server first- String zkServerAddress = line.getOptionValue(ZKHOST);- String solrHome = line.getOptionValue(SOLRHOME);- if (StrUtils.isNullOrEmpty(solrHome)) {- solrHome = System.getProperty("solr.home");- }- if (line.hasOption(VERBOSE)) {- stdout.println("Using " + SOLRHOME + "=" + solrHome);- return;- }-- String solrPort = null;- if (line.hasOption(RUNZK)) {- if (!line.hasOption(SOLRHOME)) {- stdout.println("-" + SOLRHOME + " is required for " + RUNZK);- System.exit(1);- }- solrPort = line.getOptionValue(RUNZK);- }-- SolrZkServer zkServer = null;- if (solrPort != null) {- zkServer =- new SolrZkServer(- "true",- null,- new File(solrHome, "/zoo_data"),- solrHome,- Integer.parseInt(solrPort));- zkServer.parseConfig();- zkServer.start();- }-- int minStateByteLenForCompression = -1;- Compressor compressor = new ZLibCompressor();-- if (solrHome != null) {- try {- Path solrHomePath = Paths.get(solrHome);- Properties props = new Properties();- props.put(SolrXmlConfig.ZK_HOST, zkServerAddress);- NodeConfig nodeConfig = NodeConfig.loadNodeConfig(solrHomePath, props);- minStateByteLenForCompression =- nodeConfig.getCloudConfig().getMinStateByteLenForCompression();- String stateCompressorClass = nodeConfig.getCloudConfig().getStateCompressorClass();- if (StrUtils.isNotNullOrEmpty(stateCompressorClass)) {- Class<? extends Compressor> compressionClass =- Class.forName(stateCompressorClass).asSubclass(Compressor.class);- compressor = compressionClass.getDeclaredConstructor().newInstance();- }- } catch (SolrException e) {- // Failed to load solr.xml- stdout.println(- "Failed to load solr.xml from ZK or SolrHome, put/get operations on compressed data will use data as is. If you intention is to read and de-compress data or compress and write data, then solr.xml must be accessible.");- } catch (ClassNotFoundException- | NoSuchMethodException- | InstantiationException- | IllegalAccessException- | InvocationTargetException e) {- stdout.println("Unable to find or instantiate compression class: " + e.getMessage());- System.exit(1);- }- }-- try (SolrZkClient zkClient =- new SolrZkClient.Builder()- .withUrl(zkServerAddress)- .withTimeout(SolrZkClientTimeout.DEFAULT_ZK_CLIENT_TIMEOUT, TimeUnit.MILLISECONDS)- .withConnTimeOut(- SolrZkClientTimeout.DEFAULT_ZK_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)- .withReconnectListener(() -> {})- // .withCompressor(compressor)- .withStateFileCompression(minStateByteLenForCompression, compressor)- .build()) {- if (line.getOptionValue(CMD).equalsIgnoreCase(BOOTSTRAP)) {- if (!line.hasOption(SOLRHOME)) {- stdout.println("-" + SOLRHOME + " is required for " + BOOTSTRAP);- System.exit(1);- }-- CoreContainer cc = new CoreContainer(Paths.get(solrHome), new Properties());- cc.setCoreConfigService(new ZkConfigSetService(zkClient));-- if (!ZkController.checkChrootPath(zkServerAddress, true)) {- stdout.println("A chroot was specified in zkHost but the znode doesn't exist. ");- System.exit(1);- }-- ConfigSetService.bootstrapConf(cc);-- // No need to close the CoreContainer, as it wasn't started- // up in the first place...-- } else if (line.getOptionValue(CMD).equalsIgnoreCase(UPCONFIG)) {- if (!line.hasOption(CONFDIR) || !line.hasOption(CONFNAME)) {- stdout.println("-" + CONFDIR + " and -" + CONFNAME + " are required for " + UPCONFIG);- System.exit(1);- }- String confDir = line.getOptionValue(CONFDIR);- String confName = line.getOptionValue(CONFNAME);- final String excludeExpr = line.getOptionValue(EXCLUDE_REGEX, EXCLUDE_REGEX_DEFAULT);-- if (!ZkController.checkChrootPath(zkServerAddress, true)) {- stdout.println("A chroot was specified in zkHost but the znode doesn't exist. ");- System.exit(1);- }- final Pattern excludePattern = Pattern.compile(excludeExpr);- ZkMaintenanceUtils.uploadToZK(- zkClient,- Paths.get(confDir),- ZkMaintenanceUtils.CONFIGS_ZKNODE + "/" + confName,- excludePattern);- } else if (line.getOptionValue(CMD).equalsIgnoreCase(DOWNCONFIG)) {- if (!line.hasOption(CONFDIR) || !line.hasOption(CONFNAME)) {- stdout.println("-" + CONFDIR + " and -" + CONFNAME + " are required for " + DOWNCONFIG);- System.exit(1);- }- String confDir = line.getOptionValue(CONFDIR);- String confName = line.getOptionValue(CONFNAME);- ZkMaintenanceUtils.downloadFromZK(- zkClient, ZkMaintenanceUtils.CONFIGS_ZKNODE + "/" + confName, Paths.get(confDir));- } else if (line.getOptionValue(CMD).equalsIgnoreCase(LINKCONFIG)) {- if (!line.hasOption(COLLECTION) || !line.hasOption(CONFNAME)) {- stdout.println(- "-" + COLLECTION + " and -" + CONFNAME + " are required for " + LINKCONFIG);- System.exit(1);- }- String collection = line.getOptionValue(COLLECTION);- String confName = line.getOptionValue(CONFNAME);-- ZkController.linkConfSet(zkClient, collection, confName);- } else if (line.getOptionValue(CMD).equalsIgnoreCase(LIST)) {- zkClient.printLayoutToStream(stdout);- } else if (line.getOptionValue(CMD).equals(LS)) {-- List<String> argList = line.getArgList();- if (argList.size() != 1) {- stdout.println("-" + LS + " requires one arg - the path to list");- System.exit(1);- }-- StringBuilder sb = new StringBuilder();- String path = argList.get(0);- zkClient.printLayout(path == null ? "/" : path, 0, sb);- stdout.println(sb);-- } else if (line.getOptionValue(CMD).equalsIgnoreCase(CLEAR)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 1) {- stdout.println("-" + CLEAR + " requires one arg - the path to clear");- System.exit(1);- }- zkClient.clean(arglist.get(0));- } else if (line.getOptionValue(CMD).equalsIgnoreCase(MAKEPATH)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 1) {- stdout.println("-" + MAKEPATH + " requires one arg - the path to make");- System.exit(1);- }- if (!ZkController.checkChrootPath(zkServerAddress, true)) {- stdout.println("A chroot was specified in zkHost but the znode doesn't exist. ");- System.exit(1);- }- zkClient.makePath(arglist.get(0), true);- } else if (line.getOptionValue(CMD).equalsIgnoreCase(PUT)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 2) {- stdout.println(- "-" + PUT + " requires two args - the path to create and the data string");- System.exit(1);- }- String path = arglist.get(0);- byte[] data = arglist.get(1).getBytes(StandardCharsets.UTF_8);- if (shouldCompressData(data, path, minStateByteLenForCompression)) {- // state.json should be compressed before being put to ZK- // data = compressor.compressBytes(data, data.length / 10);- }- if (zkClient.exists(path, true)) {- zkClient.setData(path, data, true);- } else {- zkClient.makePath(path, data, CreateMode.PERSISTENT, true);- }- } else if (line.getOptionValue(CMD).equalsIgnoreCase(PUT_FILE)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 2) {- stdout.println(- "-"- + PUT_FILE- + " requires two args - the path to create in ZK and the path to the local file");- System.exit(1);- }-- String path = arglist.get(0);- byte[] data = Files.readAllBytes(Path.of(arglist.get(1)));- if (shouldCompressData(data, path, minStateByteLenForCompression)) {- // state.json should be compressed before being put to ZK- // data = compressor.compressBytes(data, data.length / 10);- }- if (zkClient.exists(path, true)) {- zkClient.setData(path, data, true);- } else {- if (!ZkController.checkChrootPath(zkServerAddress, true)) {- stdout.println("A chroot was specified in zkHost but the znode doesn't exist. ");- System.exit(1);- }- zkClient.makePath(path, data, CreateMode.PERSISTENT, true);- }- } else if (line.getOptionValue(CMD).equalsIgnoreCase(GET)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 1) {- stdout.println("-" + GET + " requires one arg - the path to get");- System.exit(1);- }- byte[] data = zkClient.getData(arglist.get(0), null, null, true);- stdout.println(new String(data, StandardCharsets.UTF_8));- } else if (line.getOptionValue(CMD).equalsIgnoreCase(GET_FILE)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 2) {- stdout.println(- "-" + GET_FILE + "requires two args - the path to get and the file to save it to");- System.exit(1);- }- byte[] data = zkClient.getData(arglist.get(0), null, null, true);- Files.write(Path.of(arglist.get(1)), data);- } else if (line.getOptionValue(CMD).equals(UPDATEACLS)) {- List<String> arglist = line.getArgList();- if (arglist.size() != 1) {- stdout.println("-" + UPDATEACLS + " requires one arg - the path to update");- System.exit(1);- }- zkClient.updateACLs(arglist.get(0));- } else if (line.getOptionValue(CMD).equalsIgnoreCase(CLUSTERPROP)) {- if (!line.hasOption(NAME)) {- stdout.println("-" + NAME + " is required for " + CLUSTERPROP);- }- if (!ZkController.checkChrootPath(zkServerAddress, true)) {- stdout.println("A chroot was specified in zkHost but the znode doesn't exist. ");- System.exit(1);- }- String propertyName = line.getOptionValue(NAME);- // If -val option is missing, we will use the null value. This is required to maintain- // compatibility with Collections API.- String propertyValue = line.getOptionValue(VALUE_LONG);- ClusterProperties props = new ClusterProperties(zkClient);- try {- props.setClusterProperty(propertyName, propertyValue);- } catch (IOException ex) {- stdout.println(- "Unable to set the cluster property due to following error : "- + ex.getLocalizedMessage());- System.exit(1);- }- } else {- // If not cmd matches- stdout.println("Unknown command " + line.getOptionValue(CMD) + ". Use -h to get help.");- System.exit(1);- }- } finally {- if (solrPort != null) {- zkServer.stop();- }- }- } catch (ParseException exp) {- stdout.println("Unexpected exception:" + exp.getMessage());- }- }-- private static boolean shouldCompressData(- byte[] data, String path, int minStateByteLenForCompression) {- if (path.endsWith("state.json")- && minStateByteLenForCompression > -1- && data.length > minStateByteLenForCompression) {- // state.json should be compressed before being put to ZK- return true;- }- return false;- }-}diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java b/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.javaindex 9abde098e1c..138d729d9ee 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java@@ -62,7 +62,7 @@ public class ZkConfigSetService extends ConfigSetService {this.zkClient = cc.getZkController().getZkClient();}- /** This is for ZkCLI and some tests */+ /** This is for some tests */public ZkConfigSetService(SolrZkClient zkClient) {super(null, false);this.zkController = null;diff --git a/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java b/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.javaindex ec46f33a4c4..9ee2a7afa7b 100644--- a/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java+++ b/solr/core/src/test/org/apache/solr/cli/ZkSubcommandsTest.java@@ -59,7 +59,6 @@ import org.slf4j.LoggerFactory;// TODO: This test would be a lot faster if it used a solrhome with fewer config// files - there are a lot of them to upload-// This was copied from org.apache.solr.cloud.ZkCLITestpublic class ZkSubcommandsTest extends SolrTestCaseJ4 {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java b/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.javadeleted file mode 100644index 32170e545fc..00000000000--- a/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java+++ /dev/null@@ -1,625 +0,0 @@-/*- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */-package org.apache.solr.cloud;--import java.io.ByteArrayOutputStream;-import java.io.File;-import java.io.PrintStream;-import java.lang.invoke.MethodHandles;-import java.nio.charset.StandardCharsets;-import java.nio.file.Files;-import java.nio.file.NoSuchFileException;-import java.nio.file.Path;-import java.util.Collection;-import java.util.List;-import java.util.concurrent.TimeUnit;-import org.apache.commons.io.FileUtils;-import org.apache.commons.io.filefilter.RegexFileFilter;-import org.apache.commons.io.filefilter.TrueFileFilter;-import org.apache.solr.SolrTestCaseJ4;-import org.apache.solr.common.SolrException;-import org.apache.solr.common.cloud.ClusterProperties;-import org.apache.solr.common.cloud.SolrZkClient;-import org.apache.solr.common.cloud.VMParamsAllAndReadonlyDigestZkACLProvider;-import org.apache.solr.common.cloud.ZkNodeProps;-import org.apache.solr.common.cloud.ZkStateReader;-import org.apache.solr.common.util.ZLibCompressor;-import org.apache.solr.core.ConfigSetService;-import org.apache.solr.util.ExternalPaths;-import org.apache.zookeeper.CreateMode;-import org.apache.zookeeper.KeeperException;-import org.junit.AfterClass;-import org.junit.BeforeClass;-import org.junit.Test;-import org.slf4j.Logger;-import org.slf4j.LoggerFactory;--// TODO: This test would be a lot faster if it used a solrhome with fewer config-// files - there are a lot of them to upload-public class ZkCLITest extends SolrTestCaseJ4 {- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());-- protected ZkTestServer zkServer;-- protected Path zkDir;-- private String solrHome;-- private SolrZkClient zkClient;-- private PrintStream originalSystemOut;-- protected static final String SOLR_HOME = SolrTestCaseJ4.TEST_HOME();-- @BeforeClass- public static void beforeClass() {- System.setProperty("solrcloud.skip.autorecovery", "true");- }-- @AfterClass- public static void afterClass() {- System.clearProperty("solrcloud.skip.autorecovery");- }-- @Override- public void setUp() throws Exception {- super.setUp();- if (log.isInfoEnabled()) {- log.info("####SETUP_START {}", getTestName());- }-- String exampleHome = legacyExampleCollection1SolrHome();-- Path tmpDir = createTempDir();- solrHome = exampleHome;-- originalSystemOut = System.out;-- zkDir = tmpDir.resolve("zookeeper/server1/data");- log.info("ZooKeeper dataDir:{}", zkDir);- zkServer = new ZkTestServer(zkDir);- zkServer.run();- System.setProperty("zkHost", zkServer.getZkAddress());- SolrZkClient zkClient =- new SolrZkClient.Builder()- .withUrl(zkServer.getZkHost())- .withTimeout(AbstractZkTestCase.TIMEOUT, TimeUnit.MILLISECONDS)- .build();- zkClient.makePath("/solr", false, true);- zkClient.close();-- this.zkClient =- new SolrZkClient.Builder()- .withUrl(zkServer.getZkAddress())- .withTimeout(AbstractZkTestCase.TIMEOUT, TimeUnit.MILLISECONDS)- .build();-- if (log.isInfoEnabled()) {- log.info("####SETUP_END {}", getTestName());- }- }-- @Test- public void testCmdConstants() {- assertEquals("upconfig", ZkCLI.UPCONFIG);- assertEquals("x", ZkCLI.EXCLUDE_REGEX_SHORT);- assertEquals("excluderegex", ZkCLI.EXCLUDE_REGEX);- assertEquals(ConfigSetService.UPLOAD_FILENAME_EXCLUDE_REGEX, ZkCLI.EXCLUDE_REGEX_DEFAULT);- }-- @Test- public void testBootstrapWithChroot() throws Exception {- String chroot = "/foo/bar";- assertFalse(zkClient.exists(chroot, true));-- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress() + chroot,- "-cmd",- "bootstrap",- "-solrhome",- this.solrHome- };-- ZkCLI.main(args);-- assertTrue(zkClient.exists(chroot + ZkConfigSetService.CONFIGS_ZKNODE + "/collection1", true));- }-- @Test- public void testMakePath() throws Exception {- // test bootstrap_conf- String[] args =- new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "makepath", "/path/mynewpath"};- ZkCLI.main(args);-- assertTrue(zkClient.exists("/path/mynewpath", true));- }-- @Test- public void testPut() throws Exception {- // test put- String data = "my data";- String[] args =- new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "put", "/data.txt", data};- ZkCLI.main(args);-- zkClient.getData("/data.txt", null, null, true);-- assertArrayEquals(- zkClient.getData("/data.txt", null, null, true), data.getBytes(StandardCharsets.UTF_8));-- // test re-put to existing- data = "my data deux";- args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "put", "/data.txt", data};- ZkCLI.main(args);- assertArrayEquals(- zkClient.getData("/data.txt", null, null, true), data.getBytes(StandardCharsets.UTF_8));- }-- @Test- public void testPutCompressed() throws Exception {- // test put compressed- System.setProperty("solr.home", solrHome);- System.setProperty("minStateByteLenForCompression", "0");-- String data = "my data";- ZLibCompressor zLibCompressor = new ZLibCompressor();- byte[] dataBytes = data.getBytes(StandardCharsets.UTF_8);- byte[] expected =- random().nextBoolean()- ? zLibCompressor.compressBytes(dataBytes)- : zLibCompressor.compressBytes(dataBytes, dataBytes.length / 10);- String[] args =- new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "put", "/state.json", data};- ZkCLI.main(args);- assertArrayEquals(zkClient.getZooKeeper().getData("/state.json", null, null), expected);-- // test re-put to existing- data = "my data deux";- dataBytes = data.getBytes(StandardCharsets.UTF_8);- expected =- random().nextBoolean()- ? zLibCompressor.compressBytes(dataBytes)- : zLibCompressor.compressBytes(dataBytes, dataBytes.length / 10);- args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "put", "/state.json", data};- ZkCLI.main(args);- assertArrayEquals(zkClient.getZooKeeper().getData("/state.json", null, null), expected);- }-- @Test- public void testPutFile() throws Exception {- // test put file- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "putfile",- "/foo.xml",- SOLR_HOME + File.separator + "solr-stress-new.xml"- };- ZkCLI.main(args);-- String fromZk =- new String(zkClient.getData("/foo.xml", null, null, true), StandardCharsets.UTF_8);- Path locFile = Path.of(SOLR_HOME, "solr-stress-new.xml");- String fromLoc = Files.readString(locFile);- assertEquals("Should get back what we put in ZK", fromZk, fromLoc);- }-- @Test- public void testPutFileCompressed() throws Exception {- // test put file compressed- System.setProperty("solr.home", solrHome);- System.setProperty("minStateByteLenForCompression", "0");-- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "putfile",- "/state.json",- SOLR_HOME + File.separator + "solr-stress-new.xml"- };- ZkCLI.main(args);-- byte[] fromZk = zkClient.getZooKeeper().getData("/state.json", null, null);- Path locFile = Path.of(SOLR_HOME, "solr-stress-new.xml");- byte[] fromLoc = new ZLibCompressor().compressBytes(Files.readAllBytes(locFile));- assertArrayEquals("Should get back what we put in ZK", fromLoc, fromZk);- }-- @Test- public void testPutFileNotExists() {- // test put file- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "putfile",- "/foo.xml",- SOLR_HOME + File.separator + "not-there.xml"- };- NoSuchFileException e = expectThrows(NoSuchFileException.class, () -> ZkCLI.main(args));- assertTrue(- "Didn't find expected error message containing 'not-there.xml' in " + e.getMessage(),- e.getMessage().contains("not-there.xml"));- }-- @Test- public void testList() throws Exception {- zkClient.makePath("/test", true);- String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "list"};-- ByteArrayOutputStream byteStream = new ByteArrayOutputStream();- final PrintStream myOut = new PrintStream(byteStream, false, StandardCharsets.UTF_8);- ZkCLI.setStdout(myOut);-- ZkCLI.main(args);-- final String standardOutput = byteStream.toString(StandardCharsets.UTF_8);- String separator = System.lineSeparator();- assertEquals("/ (1)" + separator + " /test (0)" + separator + separator, standardOutput);- }-- @Test- public void testLs() throws Exception {- zkClient.makePath("/test/path", true);- String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "ls", "/test"};-- ByteArrayOutputStream byteStream = new ByteArrayOutputStream();- final PrintStream myOut = new PrintStream(byteStream, false, StandardCharsets.UTF_8);- ZkCLI.setStdout(myOut);-- ZkCLI.main(args);-- final String standardOutput = byteStream.toString(StandardCharsets.UTF_8);- String separator = System.lineSeparator();- assertEquals(- "/test (1)" + separator + " /test/path (0)" + separator + separator, standardOutput);- }-- @Test- public void testUpConfigLinkConfigClearZk() throws Exception {- File tmpDir = createTempDir().toFile();-- // test upconfig- String confsetname = "confsetone";- final String[] upconfigArgs;- if (random().nextBoolean()) {- upconfigArgs =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- ZkCLI.UPCONFIG,- "-confdir",- ExternalPaths.TECHPRODUCTS_CONFIGSET,- "-confname",- confsetname- };- } else {- final String excluderegexOption =- (random().nextBoolean() ? "--" + ZkCLI.EXCLUDE_REGEX : "-" + ZkCLI.EXCLUDE_REGEX_SHORT);- upconfigArgs =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- ZkCLI.UPCONFIG,- excluderegexOption,- ZkCLI.EXCLUDE_REGEX_DEFAULT,- "-confdir",- ExternalPaths.TECHPRODUCTS_CONFIGSET,- "-confname",- confsetname- };- }- ZkCLI.main(upconfigArgs);-- assertTrue(zkClient.exists(ZkConfigSetService.CONFIGS_ZKNODE + "/" + confsetname, true));-- // print help- // ZkCLI.main(new String[0]);-- // test linkconfig- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "linkconfig",- "-collection",- "collection1",- "-confname",- confsetname- };- ZkCLI.main(args);-- ZkNodeProps collectionProps =- ZkNodeProps.load(- zkClient.getData(ZkStateReader.COLLECTIONS_ZKNODE + "/collection1", null, null, true));- assertTrue(collectionProps.containsKey("configName"));- assertEquals(confsetname, collectionProps.getStr("configName"));-- // test down config- File confDir =- new File(- tmpDir, "solrtest-confdropspot-" + this.getClass().getName() + "-" + System.nanoTime());- assertFalse(confDir.exists());-- args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "downconfig",- "-confdir",- confDir.getAbsolutePath(),- "-confname",- confsetname- };- ZkCLI.main(args);-- File[] files = confDir.listFiles();- List<String> zkFiles =- zkClient.getChildren(ZkConfigSetService.CONFIGS_ZKNODE + "/" + confsetname, null, true);- assertEquals(files.length, zkFiles.size());-- File sourceConfDir = new File(ExternalPaths.TECHPRODUCTS_CONFIGSET);- // filter out all directories starting with . (e.g. .svn)- Collection<File> sourceFiles =- FileUtils.listFiles(- sourceConfDir, TrueFileFilter.INSTANCE, new RegexFileFilter("[^\\.].*"));- for (File sourceFile : sourceFiles) {- int indexOfRelativePath =- sourceFile- .getAbsolutePath()- .lastIndexOf("sample_techproducts_configs" + File.separator + "conf");- String relativePathofFile =- sourceFile- .getAbsolutePath()- .substring(indexOfRelativePath + 33, sourceFile.getAbsolutePath().length());- File downloadedFile = new File(confDir, relativePathofFile);- if (ConfigSetService.UPLOAD_FILENAME_EXCLUDE_PATTERN.matcher(relativePathofFile).matches()) {- assertFalse(- sourceFile.getAbsolutePath()- + " exists in ZK, downloaded:"- + downloadedFile.getAbsolutePath(),- downloadedFile.exists());- } else {- assertTrue(- downloadedFile.getAbsolutePath()- + " does not exist source:"- + sourceFile.getAbsolutePath(),- downloadedFile.exists());- assertTrue(- relativePathofFile + " content changed",- FileUtils.contentEquals(sourceFile, downloadedFile));- }- }-- // test reset zk- args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "clear", "/"};- ZkCLI.main(args);-- assertEquals(0, zkClient.getChildren("/", null, true).size());- }-- @Test- public void testGet() throws Exception {- String getNode = "/getNode";- byte[] data = "getNode-data".getBytes(StandardCharsets.UTF_8);- ByteArrayOutputStream systemOut = new ByteArrayOutputStream();- this.zkClient.create(getNode, data, CreateMode.PERSISTENT, true);- String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "get", getNode};- ZkCLI.setStdout(new PrintStream(systemOut, true, StandardCharsets.UTF_8));- ZkCLI.main(args);- assertArrayEquals(- data,- systemOut- .toString(StandardCharsets.UTF_8)- .replace(System.lineSeparator(), "")- .getBytes(StandardCharsets.UTF_8));- }-- @Test- public void testGetCompressed() throws Exception {- System.setProperty("solr.home", solrHome);- System.setProperty("minStateByteLenForCompression", "0");-- String getNode = "/getNode";- byte[] data = "getNode-data".getBytes(StandardCharsets.UTF_8);- ZLibCompressor zLibCompressor = new ZLibCompressor();- ByteArrayOutputStream systemOut = new ByteArrayOutputStream();- byte[] compressedData =- random().nextBoolean()- ? zLibCompressor.compressBytes(data)- : zLibCompressor.compressBytes(data, data.length / 10);- this.zkClient.create(getNode, compressedData, CreateMode.PERSISTENT, true);- String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "get", getNode};- ZkCLI.setStdout(new PrintStream(systemOut, true, StandardCharsets.UTF_8));- ZkCLI.main(args);- assertArrayEquals(- data,- systemOut- .toString(StandardCharsets.UTF_8)- .replace(System.lineSeparator(), "")- .getBytes(StandardCharsets.UTF_8));- }-- @Test- public void testGetFile() throws Exception {- Path tmpDir = createTempDir();-- String getNode = "/getFileNode";- byte[] data = "getFileNode-data".getBytes(StandardCharsets.UTF_8);- this.zkClient.create(getNode, data, CreateMode.PERSISTENT, true);-- Path file =- tmpDir.resolve("solrtest-getfile-" + this.getClass().getName() + "-" + System.nanoTime());- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "getfile",- getNode,- file.toAbsolutePath().toString()- };- ZkCLI.main(args);-- assertArrayEquals(data, Files.readAllBytes(file));- }-- @Test- public void testGetFileCompressed() throws Exception {- Path tmpDir = createTempDir();-- String getNode = "/getFileNode";- byte[] data = "getFileNode-data".getBytes(StandardCharsets.UTF_8);- ZLibCompressor zLibCompressor = new ZLibCompressor();- byte[] compressedData =- random().nextBoolean()- ? zLibCompressor.compressBytes(data)- : zLibCompressor.compressBytes(data, data.length / 10);- this.zkClient.create(getNode, compressedData, CreateMode.PERSISTENT, true);-- Path file =- tmpDir.resolve("solrtest-getfile-" + this.getClass().getName() + "-" + System.nanoTime());- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "getfile",- getNode,- file.toAbsolutePath().toString()- };- ZkCLI.main(args);-- assertArrayEquals(data, Files.readAllBytes(file));- }-- @Test- public void testGetFileNotExists() throws Exception {- String getNode = "/getFileNotExistsNode";-- File file = createTempFile("newfile", null).toFile();- String[] args =- new String[] {- "-zkhost", zkServer.getZkAddress(), "-cmd", "getfile", getNode, file.getAbsolutePath()- };- KeeperException e = expectThrows(KeeperException.class, () -> ZkCLI.main(args));- assertEquals(e.code(), KeeperException.Code.NONODE);- }-- public void testInvalidZKAddress() throws SolrException {- SolrException ex =- expectThrows(- SolrException.class,- () ->- new SolrZkClient.Builder()- .withUrl("----------:33332")- .withTimeout(100, TimeUnit.MILLISECONDS)- .build());- zkClient.close();- }-- @Test- public void testSetClusterProperty() throws Exception {- ClusterProperties properties = new ClusterProperties(zkClient);- // add property urlScheme=http- String[] args =- new String[] {- "-zkhost",- zkServer.getZkAddress(),- "-cmd",- "CLUSTERPROP",- "-name",- "urlScheme",- "-val",- "http"- };- ZkCLI.main(args);- assertEquals("http", properties.getClusterProperty("urlScheme", "none"));-- // remove it again- args =- new String[] {- "-zkhost", zkServer.getZkAddress(), "-cmd", "CLUSTERPROP", "-name", "urlScheme"- };- ZkCLI.main(args);- assertNull(properties.getClusterProperty("urlScheme", (String) null));- }-- @Test- public void testUpdateAcls() throws Exception {- try {- System.setProperty(- SolrZkClient.ZK_ACL_PROVIDER_CLASS_NAME_VM_PARAM_NAME,- VMParamsAllAndReadonlyDigestZkACLProvider.class.getName());- System.setProperty(- VMParamsAllAndReadonlyDigestZkACLProvider.DEFAULT_DIGEST_READONLY_USERNAME_VM_PARAM_NAME,- "user");- System.setProperty(- VMParamsAllAndReadonlyDigestZkACLProvider.DEFAULT_DIGEST_READONLY_PASSWORD_VM_PARAM_NAME,- "pass");-- String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd", "updateacls", "/"};- ZkCLI.main(args);- } finally {- // Need to clear these before we open the next SolrZkClient- System.clearProperty(SolrZkClient.ZK_ACL_PROVIDER_CLASS_NAME_VM_PARAM_NAME);- System.clearProperty(- VMParamsAllAndReadonlyDigestZkACLProvider.DEFAULT_DIGEST_READONLY_USERNAME_VM_PARAM_NAME);- System.clearProperty(- VMParamsAllAndReadonlyDigestZkACLProvider.DEFAULT_DIGEST_READONLY_PASSWORD_VM_PARAM_NAME);- }-- boolean excepted = false;- try (SolrZkClient zkClient =- new SolrZkClient.Builder()- .withUrl(zkServer.getZkAddress())- .withTimeout(- AbstractDistribZkTestBase.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS)- .build()) {- zkClient.getData("/", null, null, true);- } catch (KeeperException.NoAuthException e) {- excepted = true;- }- assertTrue("Did not fail to read.", excepted);- }-- @Override- public void tearDown() throws Exception {- if (zkClient != null) {- zkClient.close();- }- if (zkServer != null) {- zkServer.shutdown();- }- System.clearProperty("solr.home");- System.clearProperty("minStateByteLenForCompression");- System.setOut(originalSystemOut);- super.tearDown();- }-}diff --git a/solr/packaging/test/test_zk.bats b/solr/packaging/test/test_zk.batsindex c3b1cae691d..00ad93d1c87 100644--- a/solr/packaging/test/test_zk.bats+++ b/solr/packaging/test/test_zk.bats@@ -94,24 +94,6 @@ teardown() {}-@test "zkcli.sh gets 'solrhome' from 'solr.home' system property" {- sleep 1- run "${SOLR_TIP}/server/scripts/cloud-scripts/zkcli.sh" -v- local extracted_solrhome=$(echo "$output" | grep -oE "solrhome=[^ ]+")- # remove 'solrhome='- local path_value=${extracted_solrhome#*=}- [[ $path_value == *"/server/scripts/cloud-scripts/../../solr" ]] || [[ $path_value == *"/server/solr" ]]-}--@test "zkcli.sh gets 'solrhome' from 'solrhome' command line option" {- sleep 1- run "${SOLR_TIP}/server/scripts/cloud-scripts/zkcli.sh" -v -s /path/to/solr/home- local extracted_solrhome=$(echo "$output" | grep -oE "solrhome=[^ ]+")- # remove 'solrhome='- local path_value=${extracted_solrhome#*=}- [[ $path_value == "/path/to/solr/home" ]]-}-@test "bin/solr zk cp gets 'solrhome' from '--solr-home' command line option" {touch afile.txt@@ -123,7 +105,6 @@ teardown() {# The -DminStateByteLenForCompression variable substitution on solr start is not seen# by the ZkCpTool.java, so therefore we do not have compression unless solr.xml is directly edited.#assert_output --partial 'Compression of state.json has been enabled'--+rm afile.txt}diff --git a/solr/server/README.md b/solr/server/README.mdindex 0c26546614f..dd93b004706 100644--- a/solr/server/README.md+++ b/solr/server/README.md@@ -56,8 +56,7 @@ server/resourcesserver/scripts/cloud-scripts- Command-line utility for working with ZooKeeper when running in SolrCloud mode, see zkcli.sh / .cmd for- usage information.+ Command-line utility for working with snapshots using snapshotscli.shserver/solr@@ -111,4 +110,3 @@ log just to a file. To configure logging, edit the log4j2.xml file in"resources".It is also possible to setup log4j or other popular logging frameworks.-diff --git a/solr/server/scripts/cloud-scripts/zkcli.bat b/solr/server/scripts/cloud-scripts/zkcli.batdeleted file mode 100644index 0eb40faa8ea..00000000000--- a/solr/server/scripts/cloud-scripts/zkcli.bat+++ /dev/null@@ -1,27 +0,0 @@-@echo off-REM You can override pass the following parameters to this script:-REM--set JVM=java--REM Find location of this script--set SDIR=%~dp0-if "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%-set SOLR_INSTALL_DIR=%SDIR%\..\..\..-set SOLR_HOME=%SOLR_INSTALL_DIR%\server\solr--set "LOG4J_CONFIG=file:///%SDIR%\..\..\resources\log4j2-console.xml"--REM Settings for ZK ACL-REM set SOLR_ZK_CREDS_AND_ACLS=-DzkACLProvider=org.apache.solr.common.cloud.DigestZkACLProvider ^-REM -DzkCredentialsProvider=org.apache.solr.common.cloud.DigestZkCredentialsProvider ^-REM -DzkCredentialsInjector=org.apache.solr.common.cloud.VMParamsZkCredentialsInjector ^-REM -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD ^-REM -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD-REM optionally, you can use using a a Java properties file 'zkDigestCredentialsFile'-REM ...-REM -DzkDigestCredentialsFile=/path/to/zkDigestCredentialsFile.properties-REM ...-"%JVM%" %SOLR_ZK_CREDS_AND_ACLS% %ZKCLI_JVM_FLAGS% -Dlog4j.configurationFile="%LOG4J_CONFIG%" -Dsolr.home=%SOLR_HOME% ^--classpath "%SDIR%\..\..\solr-webapp\webapp\WEB-INF\lib\*;%SDIR%\..\..\lib\ext\*;%SDIR%\..\..\lib\*" org.apache.solr.cloud.ZkCLI %*diff --git a/solr/server/scripts/cloud-scripts/zkcli.sh b/solr/server/scripts/cloud-scripts/zkcli.shdeleted file mode 100755index c9dd7a50b66..00000000000--- a/solr/server/scripts/cloud-scripts/zkcli.sh+++ /dev/null@@ -1,29 +0,0 @@-#!/usr/bin/env bash--echo "WARNING: The zkcli.sh script has been deprecated in favour of the bin/solr equivalent commands."--# You can override pass the following parameters to this script:-#--JVM="java"--# Find location of this script--sdir="`dirname \"$0\"`"--log4j_config="file:$sdir/../../resources/log4j2-console.xml"--solr_home="$sdir/../../solr"--# Settings for ZK ACL-#SOLR_ZK_CREDS_AND_ACLS="-DzkACLProvider=org.apache.solr.common.cloud.DigestZkACLProvider \-# -DzkCredentialsProvider=org.apache.solr.common.cloud.DigestZkCredentialsProvider \-# -DzkCredentialsInjector=org.apache.solr.common.cloud.VMParamsZkCredentialsInjector \-# -DzkDigestUsername=admin-user -DzkDigestPassword=CHANGEME-ADMIN-PASSWORD \-# -DzkDigestReadonlyUsername=readonly-user -DzkDigestReadonlyPassword=CHANGEME-READONLY-PASSWORD"-# optionally, you can use using a a Java properties file 'zkDigestCredentialsFile'-#...-# -DzkDigestCredentialsFile=/path/to/zkDigestCredentialsFile.properties-#...-PATH=$JAVA_HOME/bin:$PATH $JVM $SOLR_ZK_CREDS_AND_ACLS $ZKCLI_JVM_FLAGS -Dlog4j.configurationFile=$log4j_config -Dsolr.home=$solr_home \--classpath "$sdir/../../solr-webapp/webapp/WEB-INF/lib/*:$sdir/../../lib/ext/*:$sdir/../../lib/*" org.apache.solr.cloud.ZkCLI ${1+"$@"}diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adocindex 6b848718c30..daf66417c5d 100644--- a/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-utilities.adoc@@ -24,17 +24,7 @@ TIP: See the section xref:cloud-screens.adoc[] for more information about usingThe ZooKeeper specific commands are provided by the xref:solr-control-script-reference.adoc[Solr Control Script].-.Solr's zkcli.sh vs ZooKeeper's zkCli.sh-[IMPORTANT]-====-The deprecated `zkcli.sh` provided by Solr is not the same as the https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_ConnectingToZooKeeper[`zkCli.sh` included in ZooKeeper distributions].--ZooKeeper's `zkCli.sh` provides a completely general, application-agnostic shell for manipulating data in ZooKeeper.--`zkcli.sh` has been deprecated in favour of the `bin/solr` equivalent commands which should be used instead. It is no longer referenced in the Reference Guide.-====--== Using Solr's ZooKeeper CLI+== Using Solr's CLI with ZooKeeperUse the `help` option to get a list of available ZooKeeper specifc commands from the script itself, as in `bin/solr zk -h`.