Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change 
notification.

The "SolrGlassfish" page has been changed by smc13.
http://wiki.apache.org/solr/SolrGlassfish?action=diff&rev1=3&rev2=4

--------------------------------------------------

  
  Note the '''METHOD.POST''' which obviously POSTs the data as parameters which 
Glassfish does seem to support.  That bypasses the issue of running a 
non-Embedded Solr instance on Glassfish with UTF-8 queries under Solrj.
  
+ 
+ 
+ If you need to add another solr instance follow the these steps:
+ 
+ 1) cd to $GLASSFISHHOME/glassfishv3/domains/''domainname''/autodeploy 
directory mentioned above. 
+ 
+ 2) copy apache-solr-1.4.0.war to <some-other-name>.war in the autodeploy 
directory. This will create a second instance that is using the same 
solr.solr.home and solr.data.dir as the first instance.
+ 
+ 3) To change the solr home you need to edit the web.xml file, which will be 
in 
$GLASSFISHHOME/glassfishv3/domains/''domainname''/applications/<some-other-name>/WEB-INF
+ 
+ 
+ A - The entry you need to change is this one:
+    <!--
+     <env-entry>
+        <env-entry-name>solr/home</env-entry-name>
+ 
+        <env-entry-value>/put/your/solr/home/here</env-entry-value>
+ 
+        <env-entry-type>java.lang.String</env-entry-type>
+     </env-entry>
+    -->
+ 
+ Just remove the comments above and below the env-entry tags and change the 
env-entry-value field and you are almost done. There is one gotcha, if you try 
to restart the application after editing the solr home, glassfish will give you 
a really long error message complaining about the position of env-entry. 
Basically, it wants the env-entry to be near the bottom after mime-mapping and 
before the </web-app>. So move the section there before saving.
+ 
+ B - Also, before restarting the application, you have to change the location 
of the data dir so it doesn't use the solr.data.dir. Create the directory you 
added in env-entry-value, put the need files and directories in it and in the 
conf directory under the just created directory change the dataDir in the 
solrconfig.xml file.
+ 
+ C - After editing the env-enty-value in the web.xml, creating the solr home, 
and editing the dataDir in solrconfig.xml, you need to restart the application. 
To do so go to the administrative console, http://servername:4848, look for 
Applications on the left, click on it, select the application you need to 
restart, and click restart. If everything went ok, it will give you a message 
that you were successful and even create the data dir.
+ 

Reply via email to