You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Solange Silva Ajuria <so...@actsa.net> on 2022/03/17 13:22:12 UTC

How to run on ip address and not on localhost?

Hello,

I have solar installed on my server which is accessed via vpn (putty) to the service installed in linux centos eg: 172.16.100.75:8983

but when I need to execute the indexing command line as shown in the examples of the reference guide, the following error appears:



[root@centos-sgd solr-8.11.1]# bin/post -c techproducts example/exampledocs/*

/usr/lib/jvm/java-1.8.0-openjdk/bin/java -classpath /root/solr-8.11.1/dist/solr-core-8.11.1.jar -Dauto=yes -Dc=techproducts -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/books.csv example/exampledocs/books.json example/exampledocs/gb18030-example.xml example/exampledocs/hd.xml example/exampledocs/ipod_other.xml example/exampledocs/ipod_video.xml example/exampledocs/manufacturers.xml example/exampledocs/mem.xml example/exampledocs/money.xml example/exampledocs/monitor2.xml example/exampledocs/monitor.xml example/exampledocs/more_books.jsonl example/exampledocs/mp500.xml example/exampledocs/post.jar example/exampledocs/sample.html example/exampledocs/sd500.xml example/exampledocs/solr-word.pdf example/exampledocs/solr.xml example/exampledocs/test_utf8.sh example/exampledocs/utf8-example.xml example/exampledocs/vidcard.xml
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/techproducts/update...
Entering auto mode. File endings considered are xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
POSTing file books.csv (text/csv) to [base]
SimplePostTool: WARNING: Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/techproducts/update
SimplePostTool: WARNING: Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/solr/techproducts/update</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>default</td></tr>
</table>

</body>
</html>

....

According to the official installation documentation

/etc/default/solr.in.sh
SOLR_HOST="172.16.100.75"



Any idea how to fix it? and have it run on http://174.13.159.10:8983 and not on http://localhost:8983


On the other hand, when I try to start the service in cloud mode, I get another error :



[root@centos-sgd solr]# bin/solr -e cloud
*** [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 63449.
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

Welcome to the SolrCloud example!

This interactive session will help you launch a SolrCloud cluster on your local workstation.
To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2]:
1
Ok, let's start up 1 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983]:
8983
Solr home directory /opt/solr/example/cloud/node1/solr already exists.

Starting up Solr on port 8983 using command:
"/opt/solr/bin/solr" start -cloud -p 8983 -s "/opt/solr/example/cloud/node1/solr"

*** [WARN] *** Your open file limit is currently 4096.
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 63449.
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'

ERROR: Failed to start Solr using command: "/opt/solr/bin/solr" start -cloud -p 8983 -s "/opt/solr/example/cloud/node1/solr" Exception : org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

[root@centos-sgd solr]# service solr status

No Solr nodes are running.


But if I execute directly , the service starts


[root@centos-sgd solr]# service 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 4096.
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
Waiting up to 180 seconds to see Solr running on port 8983 [\]
Started Solr server on port 8983 (pid=1477). Happy searching!
[root@centos-sgd solr]#



Please, help




Saludos.
Solange


RE: How to run on ip address and not on localhost?

Posted by Solange Silva Ajuria <so...@actsa.net>.
Thanks, I'll try everything you suggest.

Saludos Cordiales,


Solange Silva Ajuria 
        
  


 




-----Mensaje original-----
De: Shawn Heisey <el...@elyograg.org> 
Enviado el: jueves, 17 de marzo de 2022 10:10
Para: users@solr.apache.org
Asunto: Re: How to run on ip address and not on localhost?

On 3/17/22 07:48, Shawn Heisey wrote:
> You tried to start Solr as root. The start script detected this and 
> refused to start.  As far as I know it won't be possible to start the 
> cloud example as root because a -force parameter on the main script 
> execution will not be transferred to the later calls that start the 
> individual Solr instances in the example.

Here's a diff for the bin/solr script that should allow it to start examples as root as long as the -force parameter is provided.  There's a good chance that me sending this in the body of an email will screw up some of the lines, but I think it should end up readable enough that you could manually make the 3-line addition:

--- solr.old    2021-12-07 18:01:00.000000000 -0700
+++ solr    2022-03-17 08:07:11.101887149 -0600
@@ -1829,6 +1829,9 @@
  # otherwise let this script proceed to process the user request
  #
  if [ -n "$EXAMPLE" ] && [ "$SCRIPT_CMD" == "start" ]; then
+  if [ "$FORCE" == "true" ]; then
+    PASS_TO_RUN_EXAMPLE = "$PASS_TO_RUN_EXAMPLE -force"
+  fi
    run_tool run_example -e $EXAMPLE -d "$SOLR_SERVER_DIR" -urlScheme $SOLR_URL_SCHEME $PASS_TO_RUN_EXAMPLE
    exit $?
  fi


Re: How to run on ip address and not on localhost?

Posted by Shawn Heisey <el...@elyograg.org>.
On 3/17/22 07:48, Shawn Heisey wrote:
> You tried to start Solr as root. The start script detected this and 
> refused to start.  As far as I know it won't be possible to start the 
> cloud example as root because a -force parameter on the main script 
> execution will not be transferred to the later calls that start the 
> individual Solr instances in the example. 

Here's a diff for the bin/solr script that should allow it to start 
examples as root as long as the -force parameter is provided.  There's a 
good chance that me sending this in the body of an email will screw up 
some of the lines, but I think it should end up readable enough that you 
could manually make the 3-line addition:

--- solr.old    2021-12-07 18:01:00.000000000 -0700
+++ solr    2022-03-17 08:07:11.101887149 -0600
@@ -1829,6 +1829,9 @@
  # otherwise let this script proceed to process the user request
  #
  if [ -n "$EXAMPLE" ] && [ "$SCRIPT_CMD" == "start" ]; then
+  if [ "$FORCE" == "true" ]; then
+    PASS_TO_RUN_EXAMPLE = "$PASS_TO_RUN_EXAMPLE -force"
+  fi
    run_tool run_example -e $EXAMPLE -d "$SOLR_SERVER_DIR" -urlScheme 
$SOLR_URL_SCHEME $PASS_TO_RUN_EXAMPLE
    exit $?
  fi


Re: How to run on ip address and not on localhost?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/17/22 07:22, Solange Silva Ajuria wrote:
> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
> <title>Error 404 Not Found</title>

This would seem to indicate that the techproducts index doesn't exist.  
The fact that you got a 404 means something is listening on the port.

> According to the official installation documentation
>
> /etc/default/solr.in.sh
> SOLR_HOST="172.16.100.75"

The SOLR_HOST variable doesn't affect Solr's network operation. It 
determines what name a SolrCloud system will use when it registers 
itself in the zookeeper database.

Solr versions up through 8.x will listen on all network interfaces.  
When Solr 9.0 is released, it will only listen on 127.0.0.1.  You can 
get the old behavior of listening on all interfaces on a 9.x version by 
setting the SOLR_JETTY_HOST variable to 0.0.0.0 in solr.in.sh or 
solr.in.cmd.

> 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'


That's the relevant error from when you tried to start the cloud example.

You tried to start Solr as root. The start script detected this and 
refused to start.  As far as I know it won't be possible to start the 
cloud example as root because a -force parameter on the main script 
execution will not be transferred to the later calls that start the 
individual Solr instances in the example.

Change the ownership on the extracted files and run the command as a 
regular user, not root.

Thanks,
Shawn