New clients frequently consult us about zkcli script connection errors. They encounter this difficulty when they first attempt to upload the Solr configuration files to Zookeeper. (See zkcli download instructions.) This page lists the most common complaints and their solutions.
Security Best Practices
Be sure to see our page on securing Zookeeper using SearchStax.
Java: Command Not Found
When zkcli gives you an error claiming “java command not known,” it means that Java is not properly installed on your computer.
Run $ java -version to see if Java is installed.
Each Managed Solr deployment has its own Zookeeper and HTTP Endpoint URLs:
It is very common for a new user to confused one URL with the other. If you feed the HTTP Endpoint to the zkcli script, you will see some puzzling errors. (The Zookeeper Ensemble is at port 2181.)
Timeout at 30000 ms
Several Managed Solr users have reported a 30-second timeout the first time they tried to upload a SOLR configuration.
The error message resembles this one:
Caused by java.util.concurrent.TimeoutException: Could not connect to ZooKeeper <instance url> within 30000 ms
This failure is often due to a blocked port 2181 (the ZooKeeper port) in the user’s local firewall. Have your local IT department open the port for you.
The same error appears when the Zookeeper ensemble is protected by IP Filtering and your IP address is not listed among the filters.
Something similar can happen if a Zookeeper instance stops running. That situation is very rare, and is not usually encountered on your first attempt to use zkcli. Please contact our Support Desk so we can check it for you.
Class Path Error
Sometimes zkcli returns the following error:
Error: Could not find or load main class org.apache.solr.cloud.ZkCLI
We have seen this error in situations where a Windows user tries to run zkcli.sh using a Linux emulator such as cygwin or MinGW. Class paths do not translate well between the emulator and the underlying Windows system.
The solution is to use zkcli.bat from a Windows command prompt. Switch to the emulator to run the subsequent cURL commands.
Config Path Error
Another common zkcli error is:
Error: Path ...\conf does not exist!
The config directory path was incorrect. Note that the conf directory paths are not the same for the solr-6 and solr-7 scripts. The choices are: