[ 
https://issues.apache.org/jira/browse/SOLR-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Timothy Potter updated SOLR-3617:
---------------------------------

    Attachment: SOLR-3617.patch

Updated patch with changes to complement the patch I'm posting for SOLR-3619. 
Specifically, there are two improvements to the bin/solr script in this patch:

1) Interactive session with user to start the SolrCloud example. I think this 
approach is good for a couple of reasons: 

   a. no weird command-line settings like bootstrap_conf ...
   b. interactive session uses the same commands that a user should use to 
deploy a configuration directory (zkcli) and create a collection; what's more 
is the script shows the commands it is running so the user gets an example of 
how to do this again.

I'm thinking of adding a -q (quiet) flag to skip all the prompts and just 
accept defaults, but for now, here's what the interactive session looks like:

{code}
[~/dev/lw/projects/solr_trunk_co/solr]$ bin/solr -e cloud

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? 
(1-4) [2] 
Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983] 
8983
Please enter the port for node2 [7574] 
7574
Cloning Solr server directory into 
/Users/thelabdude/dev/lw/projects/solr_trunk_co/solr/node1
Cloning Solr server directory into 
/Users/thelabdude/dev/lw/projects/solr_trunk_co/solr/node2

Starting up SolrCloud node1 on port 8983 using command:


solr start -c -d /Users/thelabdude/dev/lw/projects/solr_trunk_co/solr/node1 -p 
8983 


Waiting to see Solr listening on port 8983 [/]  
Started Solr server on port 8983 (pid=55965). Happy searching!

    

Starting node2 on port 7574 using command:


solr start -c -d /Users/thelabdude/dev/lw/projects/solr_trunk_co/solr/node2 -p 
7574 -z localhost:9983 


Waiting to see Solr listening on port 7574 [/]  
Started Solr server on port 7574 (pid=56050). Happy searching!

    
Now let's create a new collection for indexing documents in your 2-node cluster.

Please provide a name for your new collection: [gettingstarted] 
gettingstarted
How many shards would you like to split gettingstarted into? [2] 
2
How many replicas per shard would you like to create? [2] 
2
Deploying default Solr configuration files to embedded ZooKeeper using command:


/Users/thelabdude/dev/lw/projects/solr_trunk_co/solr/server/scripts/cloud-scripts/zkcli.sh
 -zkhost localhost:9983 -cmd upconfig -confdir 
/Users/thelabdude/dev/lw/projects/solr_trunk_co/solr/example/example-schemaless/solr/collection1/conf
 -confname schemaless

INFO  - 2014-07-29 12:56:28.201; org.apache.zookeeper.Environment; Client 
environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT
_... Whole bunch more log messages here ..._
INFO  - 2014-07-29 12:56:33.659; org.apache.zookeeper.ClientCnxn$EventThread; 
EventThread shut down


Creating new collection gettingstarted with 2 shards and replication factor 2 
using Collections API command:

http://localhost:8983/solr/admin/collections?action=CREATE&name=gettingstarted&replicationFactor=2&numShards=2&collection.configName=schemaless&maxShardsPerNode=2&wt=json&indent=2

For more information about the Collections API, please see: 
https://cwiki.apache.org/confluence/display/solr/Collections+API

{
  "responseHeader":{
    "status":0,
    "QTime":6045},
  "success":{
    "":{
      "responseHeader":{
        "status":0,
        "QTime":3735},
      "core":"gettingstarted_shard2_replica1"},
    "":{
      "responseHeader":{
        "status":0,
        "QTime":3850},
      "core":"gettingstarted_shard1_replica1"},
    "":{
      "responseHeader":{
        "status":0,
        "QTime":4091},
      "core":"gettingstarted_shard1_replica2"},
    "":{
      "responseHeader":{
        "status":0,
        "QTime":4093},
      "core":"gettingstarted_shard2_replica2"}}}


SolrCloud example running, please visit http://localhost:8983/solr 
{code}

2) Works with the server directory instead of example (based on work being done 
for SOLR-3619)



> Consider adding start scripts.
> ------------------------------
>
>                 Key: SOLR-3617
>                 URL: https://issues.apache.org/jira/browse/SOLR-3617
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Mark Miller
>            Assignee: Timothy Potter
>         Attachments: SOLR-3617.patch, SOLR-3617.patch, SOLR-3617.patch
>
>
> I've always found that starting Solr with java -jar start.jar is a little odd 
> if you are not a java guy, but I think there are bigger pros than looking 
> less odd in shipping some start scripts.
> Not only do you get a cleaner start command:
> sh solr.sh or solr.bat or something
> But you also can do a couple other little nice things:
> * it becomes fairly obvious for a new casual user to see how to start the 
> system without reading doc.
> * you can make the working dir the location of the script - this lets you 
> call the start script from another dir and still have all the relative dir 
> setup work.
> * have an out of the box place to save startup params like -Xmx.
> * we could have multiple start scripts - say solr-dev.sh that logged to the 
> console and default to sys default for RAM - and also solr-prod which was 
> fully configured for logging, pegged Xms and Xmx at some larger value (1GB?) 
> etc.
> You would still of course be able to make the java cmd directly - and that is 
> probably what you would do when it's time to run as a service - but these 
> could be good starter scripts to get people on the right track and improve 
> the initial user experience.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to