You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Raymond Lee (JIRA)" <ji...@apache.org> on 2013/06/03 22:42:20 UTC

[jira] [Commented] (SOLR-4450) Developer Curb Appeal: Need consistent command line arguments for all nodes

    [ https://issues.apache.org/jira/browse/SOLR-4450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13673528#comment-13673528 ] 

Raymond Lee commented on SOLR-4450:
-----------------------------------

Just want to follow up on original poster's question regarding syntax that caused "SEVERE: null:java.lang.IllegalArgumentException: port out of range:-1".  I have the following setup and it appears to be running correctly.  I.e. Leader re-election works with Solr Embedded Zookeeper when one leader fails.

== Configuration ==
ServerA:  192.168.56.101
solrA1:   192.168.56.101/8983
solrA2:   192.168.56.101/8900

ServerB:  192.168.56.102
solrB1:   192.168.56.102/8983
solrB2:   192.168.56.102/8900

== Steps to bring up the servers ==
1. Start up solrA1 from bash:
[root@192.168.56.101  example]$java -DzkRun -DnumShards=2 -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DzkHost=localhost:9983,192.168.56.101:9900,192.168.56.102:9983,192.168.56.102:9900 -jar start.jar

2. Start up solrA2 from bash:
[root@192.168.56.101  exampleB]$java -Djetty.port=8900 -DzkRun -DzkHost=192.168.56.101:9983,localhost:9900,192.168.56.102:9983,192.168.56.102:9900 -jar start.jar

3. Start up solrB1 from bash:
[root@192.168.56.102  example]$java -Djetty.port=8983 -DzkRun -DzkHost=192.168.56.101:9983,192.168.56.101:9900,localhost:9983,192.168.56.102:9900 -jar start.jar

4. Start up solrB2 from bash:
[root@192.168.56.102  exampleB]$java -Djetty.port=8900 -DzkRun -DzkHost=192.168.56.101:9983,192.168.56.101:9900,192.168.56.102:9983,localhost:9900 -jar start.jar

== Dev. Note ==
Originally, I ran into the same exception as Mark Bennett, seeing "SEVERE: null:java.lang.IllegalArgumentException: port out of range:-1".  I then downloaded the lucense_solr source code, put it in the debugger. etc.  With version 3.4.5 (may be other versions also) of Solr, it turns out that line 269 of SolrZkServer.java is trying to compare the string "localhost" with the given list of Hostnames as defined by "-DzkHost"

[SolrZkServer.java]
....
line 251:  String myHost = "localhost";
....
line 267:  int port = 0;
....
line 269:     if (server.addr.getHostName().equals(myHost)) {....
....
line 272:         port = server.addr.getPort();
....
line 278:  setClientPort(port - 1);
....

So if server.addr.getHostName() never returns "localhost", then line 272 would not run and hence, port number would default to "0".  Then line 278 will set it to "-1".  Hence, port out of range exception.

Hopefully, someone can put a note about this on the immutable page at https://wiki.apache.org/solr/SolrCloud 

HTH



                
> Developer Curb Appeal: Need consistent command line arguments for all nodes
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-4450
>                 URL: https://issues.apache.org/jira/browse/SOLR-4450
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 4.1
>            Reporter: Mark Bennett
>             Fix For: 4.4
>
>
> Suppose you want to create a small 4 node cluster (2x2, two shards, each replicated), each on it's own machine.
> It'd be nice to use the same script in /etc/init.d to start them all, but it's hard to come up with a set of arguments that works for both the first and subsequent nodes.
> When MANUALLY starting them, the arguments for the first node are different than for subsequent nodes:
> Node A like this:
>     -DzkRun -DnumShards=2 -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=MyConfig -jar start.jar
> Vs. the other 3 nodes, B, C, D:
> 	-DzkHost=nodeA:9983 -jar start.jar
> But if you combine them, you either still have to rely on Node A being up first, and have all nodes reference it:
>     -DzkRun -DzkHost=nodeA:9983 -DnumShards=2 -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=MyConfig
> OR you can try to specify the address of all 4 machines, in all 4 startup scripts, which seems logical but doesn't work:
>     -DzkRun -DzkHost=nodeA:9983,nodeB:9983,nodeC:9983,nodeD:9983 -DnumShards=2 -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=MyConfig
> This gives an error:
> org.apache.solr.common.SolrException log
> SEVERE: null:java.lang.IllegalArgumentException: port out of range:-1
> This thread suggests a possible change in syntax, but doesn't seem to work (at least with the embedded ZooKeeper)
> Thread:
> http://lucene.472066.n3.nabble.com/solr4-0-problem-zkHost-with-multiple-hosts-throws-out-of-range-exception-td4014440.html
> Syntax:
>     -DzkRun -DzkHost=nodeA:9983,nodeB:9983,nodeC:9983,nodeD:9983/solrroot -DnumShards=2 -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=MyConfig
> Error:
> SEVERE: Could not start Solr. Check solr/home property and the logs
> Feb 12, 2013 1:36:49 PM org.apache.solr.common.SolrException log
> SEVERE: null:java.lang.NumberFormatException: For input string: "9983/solrroot"
>         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> So:
> * There needs to be some syntax that all nodes can run, even if it requires listing addresses  (or multicast!)
> * And then clear documentation about suggesting external ZooKeeper to be used for production (list being maintained in SOLR-4444)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org