{"id":118,"date":"2024-04-29T19:08:04","date_gmt":"2024-04-29T19:08:04","guid":{"rendered":"https:\/\/www.rajeshkumar.xyz\/blog\/?p=118"},"modified":"2024-04-29T19:21:01","modified_gmt":"2024-04-29T19:21:01","slug":"apache-solr-errors-and-solutions","status":"publish","type":"post","link":"https:\/\/www.rajeshkumar.xyz\/blog\/apache-solr-errors-and-solutions\/","title":{"rendered":"Apache Solr Errors and Solutions"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Error<\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">.\/solr start\n*** &#91;WARN] *** Your open file limit is currently <span class=\"hljs-number\">1024.<\/span>\n It should be <span class=\"hljs-keyword\">set<\/span> to 65000 to avoid operational disruption.\n If you no longer wish to see this warning, <span class=\"hljs-keyword\">set<\/span> SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh\n*** &#91;WARN] ***  Your Max Processes Limit is currently 31369.\n It should be <span class=\"hljs-keyword\">set<\/span> to 65000 to avoid operational disruption.\n If you no longer wish to see this warning, <span class=\"hljs-keyword\">set<\/span> SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh\nWARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.\n         Please consult the Reference Guide. To override this check, start with argument '-force'\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Solution<\/p>\n\n\n\n<p>The warning messages indicate a couple of issues with running Solr:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open File and Process Limits<\/strong>: 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 <code>SOLR_ULIMIT_CHECKS<\/code> to false in <code>solr.in.sh<\/code>.<\/li>\n\n\n\n<li><strong>Security Warning<\/strong>: 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 <code>-force<\/code> option, but it&#8217;s better to run it as a normal user.<\/li>\n<\/ol>\n\n\n\n<p>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.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">To <span class=\"hljs-keyword\">set<\/span> the open file limit and the maximum number of processes to 65000 on Ubuntu for running Solr, you can use the following steps:\n\nEdit Limits Configuration: Open the limits configuration file with a text editor using sudo privileges:\n\nsudo nano \/etc\/security\/limits.conf\n\nSet the Limits: Add the following lines at the end of the file to <span class=\"hljs-keyword\">set<\/span> the required limits for the user running Solr (replace username with the actual user account):\n\nusername soft nofile 65000\nusername hard nofile 65000\nusername soft nproc 65000\nusername hard nproc 65000\n\nroot soft nofile 65000\nroot hard nofile 65000\nroot soft nproc 65000\nroot hard nproc 65000\n\nApply Changes: For the changes to take effect, you may need to logout and log back in, or reboot the system.\nCheck Limits: After logging back in, check the new limits with:\n\n$ ulimit -n 65000\n$ ulimit -u 65000\n\n\nulimit -n  # For open files limit\nulimit -u  # For max processes limit<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">root@ip<span class=\"hljs-number\">-172<\/span><span class=\"hljs-number\">-31<\/span><span class=\"hljs-number\">-41<\/span><span class=\"hljs-number\">-118<\/span>:\/opt\/solr<span class=\"hljs-number\">-9.6<\/span><span class=\"hljs-number\">.0<\/span>\/bin<span class=\"hljs-comment\"># .\/solr start<\/span>\nWARNING: Starting Solr <span class=\"hljs-keyword\">as<\/span> the root user is a security risk <span class=\"hljs-keyword\">and<\/span> not considered best practice. Exiting.\n         Please consult the Reference Guide. To override this check, start with argument <span class=\"hljs-string\">'-force'<\/span>\nroot@ip<span class=\"hljs-number\">-172<\/span><span class=\"hljs-number\">-31<\/span><span class=\"hljs-number\">-41<\/span><span class=\"hljs-number\">-118<\/span>:\/opt\/solr<span class=\"hljs-number\">-9.6<\/span><span class=\"hljs-number\">.0<\/span>\/bin<span class=\"hljs-comment\"># .\/solr start -force<\/span>\nJava <span class=\"hljs-number\">17<\/span> detected. Enabled workaround <span class=\"hljs-keyword\">for<\/span> SOLR<span class=\"hljs-number\">-16463<\/span>\nWaiting up to <span class=\"hljs-number\">180<\/span> seconds to see Solr running on port <span class=\"hljs-number\">8983<\/span> &#91;|]\nStarted Solr server on port <span class=\"hljs-number\">8983<\/span> (pid=<span class=\"hljs-number\">197734<\/span>). Happy searching!\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Error: solr is not accessible on IP address<\/h2>\n\n\n\n<p>If Apache Solr is not accessible via an IP address, here are several common issues to check and steps to resolve them:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Firewall Settings<\/strong>: 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.<\/li>\n\n\n\n<li><strong>Solr Configuration<\/strong>: Check Solr&#8217;s configuration to ensure it is set to listen on the server&#8217;s IP address, not just localhost. You can find this setting in the <code>solr.in.sh<\/code> or <code>solr.in.cmd<\/code> file for Unix and Windows respectively. Look for the <code>SOLR_JETTY_HOST<\/code> parameter and set it to <code>0.0.0.0<\/code> to allow Solr to accept requests from any IP.<\/li>\n\n\n\n<li><strong>Network Configuration<\/strong>: Verify that there are no network issues blocking access to the server where Solr is hosted. This includes checking network interfaces and IP configurations.<\/li>\n\n\n\n<li><strong>Check Server Logs<\/strong>: Review Solr server logs for any errors or messages that could indicate why the service isn&#8217;t accessible. These logs are typically found in the <code>logs<\/code> directory in your Solr installation.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Error Solution The warning messages indicate a couple of issues with running Solr: Adjusting the system settings for file and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-apache-solr"],"_links":{"self":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":4,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":122,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions\/122"}],"wp:attachment":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}