5

With Solr 4.x, http://localhost:8983/solr/admin/cores returns an XML description of loaded cores, which indicates the file path location of the instanceDir.

...
<lst name="collection1">
 <str name="name">collection1</str>
 <bool name="isDefaultCore">true</bool>
 <str name="instanceDir">C:\solr\solr-4.10.1\example\solr\collection1\</str>
...

On my Windows 7 PC, this is presented as a full path, but others have reported this as relative path. What factors can cause this value to be presented as a relative path, and is there a way to force this to be presented as a full path?

Dan Solovay
  • 3,134
  • 3
  • 26
  • 55

1 Answers1

2

Can you please confirm if you have set solr.home. Please check this Solr Wiki for more details. I hope setting solr.home should resolve the issue.

You can add it as JVM argument

java -Dsolr.solr.home=/your/solr/home/path/here -jar start.jar

Incase of Tomcat, you can also do as below

export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/your/solr/home/path/here"

Thanks

RN110
  • 91
  • 5
  • How would this be set? From the command line when launching Solr? – Dan Solovay Aug 09 '16 at 21:43
  • I try to run the following command but it fails. Am I missing something? `C:\Solr-4.7.2\example> java -Dsolr.solr.home=C:\Solr-4.7.2\example -jar start.jar` `Error: Could not find or load main class .solr.home=C:\Solr-4.7.2\example` – Serhii Shushliapin Aug 11 '16 at 16:04
  • I'm awarding the bounty because the information and documentation link are helpful, but I'm leaving the question marked as unanswered because I'm still looking for the factors that lead the path to be expressed as relative in the /solr/admin/cores response. I need this information to update documentation. – Dan Solovay Aug 13 '16 at 19:19
  • @SergeyShushlyapin,I was able to get this to work. I copied my collection1 directory to D:\solr\temp, and then this command launched Solr successfully to port 9999: `D:\solr\solr-4.7.2\example>java -Dsolr.solr.home=D:\solr\temp -jar start.jar -Dj etty.port=9999` As I noted above, I still don't understand why you weren't seeing the full path. – Dan Solovay Aug 13 '16 at 19:26
  • @DanSolovay, yes, it works but only if executed from `cmd`. In PowerShell it fails with the error above, but that is another issue (I guess). – Serhii Shushliapin Aug 15 '16 at 06:47