Apache Solr Errors and Solutions

Posted by

Error

./solr start
*** [WARN] *** Your open file limit is currently 1024.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 31369.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.
         Please consult the Reference Guide. To override this check, start with argument '-force'

Solution

The warning messages indicate a couple of issues with running Solr:

  1. Open File and Process Limits: Solr recommends setting the open file limit and the maximum number of processes to 65000 to avoid operational problems. You can adjust these settings in your system or disable the checks by setting SOLR_ULIMIT_CHECKS to false in solr.in.sh.
  2. Security Warning: Solr strongly discourages running as the root user due to security risks. If you absolutely must run Solr as root, you can override this with the -force option, but it’s better to run it as a normal user.

Adjusting the system settings for file and process limits may require administrator privileges, and should be done carefully to ensure Solr runs optimally and securely.

To set the open file limit and the maximum number of processes to 65000 on Ubuntu for running Solr, you can use the following steps:

Edit Limits Configuration: Open the limits configuration file with a text editor using sudo privileges:

sudo nano /etc/security/limits.conf

Set the Limits: Add the following lines at the end of the file to set the required limits for the user running Solr (replace username with the actual user account):

username soft nofile 65000
username hard nofile 65000
username soft nproc 65000
username hard nproc 65000

root soft nofile 65000
root hard nofile 65000
root soft nproc 65000
root hard nproc 65000

Apply Changes: For the changes to take effect, you may need to logout and log back in, or reboot the system.
Check Limits: After logging back in, check the new limits with:

$ ulimit -n 65000
$ ulimit -u 65000


ulimit -n  # For open files limit
ulimit -u  # For max processes limit
root@ip-172-31-41-118:/opt/solr-9.6.0/bin# ./solr start
WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.
         Please consult the Reference Guide. To override this check, start with argument '-force'
root@ip-172-31-41-118:/opt/solr-9.6.0/bin# ./solr start -force
Java 17 detected. Enabled workaround for SOLR-16463
Waiting up to 180 seconds to see Solr running on port 8983 [|]
Started Solr server on port 8983 (pid=197734). Happy searching!

Error: solr is not accessible on IP address

If Apache Solr is not accessible via an IP address, here are several common issues to check and steps to resolve them:

  1. Firewall Settings: Ensure that the firewall settings on your server allow traffic on the port Solr is running on (default is 8983). You might need to add a rule to allow this port.
  2. Solr Configuration: Check Solr’s configuration to ensure it is set to listen on the server’s IP address, not just localhost. You can find this setting in the solr.in.sh or solr.in.cmd file for Unix and Windows respectively. Look for the SOLR_JETTY_HOST parameter and set it to 0.0.0.0 to allow Solr to accept requests from any IP.
  3. Network Configuration: Verify that there are no network issues blocking access to the server where Solr is hosted. This includes checking network interfaces and IP configurations.
  4. Check Server Logs: Review Solr server logs for any errors or messages that could indicate why the service isn’t accessible. These logs are typically found in the logs directory in your Solr installation.

Leave a Reply

Your email address will not be published. Required fields are marked *