Search code examples
windowssolrcygwin

Starting Solr 7.2.1 with startup parameters on Windows via Cygwin


I'm upgrading Solr 4.3.1 to Solr 7.2.1

I used to start Solr 4.3.1 like so:

C:
chdir C:\cygwin\bin

bash -c "cd /cygdrive/c/Databases/solr-4.3.1/example/;java -Dsolr.solr.home="./example-DIH/solr/" -jar -Xms200m -Xmx1600m start.jar -OPTIONS=jsp" 

However, when I try this:

C:
chdir C:\cygwin\bin

bash -c "cd /cygdrive/c/Databases/solr-7.2.1/example/;java -Dsolr.solr.home="./example-DIH/solr/" -jar -Xms200m -Xmx1600m start.jar -OPTIONS=jsp" 

Error: Unable to access jarfile start.jar

I then copy start.jar from C:\Databases\solr-4.3.1\example to C:\Databases\solr-7.2.1\example

And re-run the .bat file, but then I get

java.io.FileNotFoundException: No XML configuration files specified in start.config or command line. at org.eclipse.jetty.start.Main.start(Main.java:506) at org.eclipse.jetty.start.Main.main(Main.java:95)

Usage: java -jar start.jar [options] [properties] [configs] java -jar start.jar --help # for more information

However, in my old Solr environment I don't see a start.config either and I'm passing the same parameters over the command line.

Without Cygwin I can start Solr successfully:

C:\Databases\solr-7.2.1\bin>solr.cmd start -p 8984
Waiting up to 30 to see Solr running on port 8984
Started Solr server on port 8984. Happy searching!

UPDATE 1

@Holger below pointed out there's a server folder. I have that folder and there's already a start.jar file in there.

So I tried:
bash -c "cd /cygdrive/C/Databases/solr-7.2.1/server/;java -Dsolr.solr.home="solr/" -jar -Xms200m -Xmx1600m start.jar -OPTIONS=jsp"

But then I get:

WARNING: System properties and/or JVM args set. Consider using --dry-run or --exec WARNING: Nothing to start, exiting ...

How can I start Solr 7.2.1 (on Windows) via Cygwin with additional parameters (like memory allocation)


Solution

  • I had similar problems as I updated from 4.x to 7.x, but on OS X.

    Is there a directory ../solr-7.2.1/server? Then try with start.jar not in

    ../solr-7.2.1/example 
    

    but in

    ../solr-7.2.1/server. 
    

    The working directory has to be the directory containing start.jar. So be in

     ../solr-7.2.1/server 
    

    when starting solr. You propably have to set

    --module=http -Dsolr.log.dir=...
    

    too. This is what worked for me.

    Note the release notes for Release 5.2.0 [2015-06-07]

    "It is no longer possible to run "java -jar start.jar" from inside the server directory. The bin/solr script is the only supported way to run Solr. This is necessary to support HTTP and HTTPS modules in Jetty which can be selectively enabled by the bin/solr scripts. In case you have a pressing need to run solr the old way, you can run "java -jar start.jar --module=http" to get the same behavior as before."