Ubuntu upgrade (14.04.3) and solr upgrade (5.3) breaks solr3/jetty setup - solr

While upgrading our production server to ubuntu 14 the solr/jetty broke.
To fix i tried:
- upgraded java version to 8.
- upgraded solr to 5.3
My earlier config used .war files. realized that now its stopped supporting .war files, so now cannot use my earlier config.
This was the steps i used earlier:
copy the solr.war file from the downloaded and untarred solr to the webapps folder, and make jetty owner:
sudo cp ~/x/apache-solr-3.6.1/dist/apache-solr-3.6.1.war /usr/share/jetty/webapps/solr.war
sudo chown jetty:jetty /usr/share/jetty/webapps/solr.war
create a context file in JETTY_HOME/contexts (sudo vim /usr/share/jetty/contexts/solr.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<!-- Set the solr.solr.home system property -->
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Call name="setProperty" class="java.lang.System">
<Arg type="String">solr.solr.home</Arg>
<Arg type="String">/usr/share/solr</Arg>
</Call>
</Configure>
tell solr how many cores we have and what those are in SOLR_HOME (sudo vim /usr/share/solr/solr.xml):
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core name="demo" instanceDir="demo" />
<core name="dev" instanceDir="dev" />
<core name="qa" instanceDir="qa" />
<core name="www" instanceDir="www" />
</cores>
</solr>
etc.
Don't want to use the solr instance that comes with rsolr (4), if i can help it. But can't find corresponding info for solr 5.3
Running rails 3.2.21. and solr_sunspot gem 2.2.0
Thanks in advance!

Related

Default core name in solr 1.4.1

I cannot set up default core in solr 1.4.1
<cores adminPath="/admin/cores" defaultCoreName="core0">
It doesn't work. The server starts as usual and works but doesn't allow making requests without core name. I went through their release notes and couldn't find when they started supporting this parameter. Does solr 1.4.1 support it? What are the other options?
UPD: The whole solr configs looks this way
<solr persistent="true">
<cores adminPath="/admin/cores" defaultCoreName="core0">
<core name="core0" instanceDir="./core0" />
<core name="core1" instanceDir="./core1" />
</cores>
</solr>
How I check:
1) Check without core(returns HTTP 400 now, "missing solr core name in path")
http://127.0.0.1:8080/solr/select?q=test&version=2.2&start=0&rows=10&indent=on
2) Check with core(response is correct) http://127.0.0.1:8080/solr/core0/select?q=test&version=2.2&start=0&rows=10&indent=on
The answer is No. DefaultCoreName is not supported in solr 1.4.1
I installed solr 3.5 and set up multicore environment, after specifying defaultCoreName I was able to perform the following two requests and the response was the same
http://127.0.0.1:8080/solr/select/?q=solr&version=2.2&start=0&rows=10&indent=on
and
http://127.0.0.1:8080/solr/core0/select/?q=solr&version=2.2&start=0&rows=10&indent=on
Yes it supported in 1.4.
You can try by making it as persistant = true if you want to add more core by the using solr api for managing the core.
If you don't want the default core you can remove it from the xml.
You can have you solr.xml as below and try.
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="./"/>
</cores>
</solr>
another would be if add your own core by mentioning the data dir and insatance dir..
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores adminPath="/admin/cores">
<core name="Test" instanceDir="/home/abhijit/Downloads/Solr/" dataDir="/home/abhijit/Downloads/Solr/Test/data"/>
</cores>
</solr>

Error deploying configuration descriptor Solr

I have done the below steps for Solr Integration to tomcat on windows machine.Can you please clarify what am I doing wrong here.
1) Download Solr and unzipped Solr 5.2.1 to the below directory C:\downloads\solr-5.2.1\solr-5.2.1.
2)Download Tomcat 7 zipped version and unzipped it to below location C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62
3)Copy Jar files from C:\downloads\solr-5.2.1\solr-5.2.1\dist\solrj-lib directory to C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62\lib directory.
4) Create a solr.xml in the C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62\conf\Catalina\localhost folder.
<?xml version='1.0' encoding='UTF-8'?>
<context docBase="C:/downloads/apache-tomcat-7.0.62/apache-tomcat-7.0.62/webapps/solr.war" debug="0" crossContext="true" >
<environment name="solr" type="java.lang.String" value="/apache-tomcat-7.0.62/webapps/" override="true"></environment>
</context>
5)Copy solr.war file from C:\downloads\solr-5.2.1\solr-5.2.1\server\webapps to
C:\downloads\apache-tomcat-7.0.62\apache-tomcat-7.0.62\webapps folder.
6)Start the tomcat using startup.bat command in bin folder
7)Edit web.xml to
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:/downloads/solr-5.2.1/solr-5.2.1</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
8)Restart the tomcat and hit the url http://localhost:8080/solr I get 404 Not found Error.The error in the console is
SEVERE: Error deploying configuration descriptor C:\downloads\apache-tomcat-7.0.
62\apache-tomcat-7.0.62\conf\Catalina\localhost\solr.xml
java.lang.NullPointerException
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
va:645)
The Solr wiki states that running 5.x versions on Tomcat is no longer supported:
Internally, Solr is still implemented via Servlet APIs and is powered by Jetty -- but this is simply an implementation detail. Deployment as a "webapp" to other Servlet Containers (or other instances of Jetty) is not supported, and may not work in future 5.x versions of Solr when additional changes are likely to be made to Solr internally to leverage custom networking stack features.

Want to deploy Solr 4.0.0 on JBoss 6.0.1

I am new for Solr installation on JBoss. Can anyone help me to deploy Solr 4.0.0 on JBoss 6.0.1?
Thanks in advance!!
You can find the instructions to install Solr in JBoss in the "official" solr documentation (http://wiki.apache.org/solr/SolrJBoss). In general installing Solr in any Container/Application Server consists of deploying the "war" file in the deployment directory (in jboss "deployment" directory of the installation), then define the environment variable "solr.solr.home" and "solr.data.dir", which should point for the directory where you have your "solr" (where you extracted/placed your Solr distribution) - you can define these in the "JBOSS_HOME/standalone/configuration/standalone.xml" file, like this:
<system-properties>
<property name="solr.solr.home" value="/usr/local/jboss/solr/solr-4.2.1"/>
<property name="solr.data.dir" value="/usr/local/jboss/solr/data"/>
<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
<property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
</system-properties>

My Solr Core1 (mutlicore) is not working?

I am trying for multicores somehow i am able to run my core0 but core1 is not finding. 404 err0r is there can any buddy tell me what is the right configuration in solr.xml.
I am preferring sorl wiki core admin help.
Thanks!
As it is described Solr Wiki, solr.xml should look like :
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core name="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
</cores>
</solr>
And your solr directory should be like :
-solr
-core0
+conf
+data
-core1
+conf
+data
+lib
solr.xml
Also run create core for adding new cores. The command for creating core is :
http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&config=config_file_name.xml&schema=schem_file_name.xml&dataDir=data
You should give more details about your problem, in order to get detailed answer.

Getting "missing core name in path" when trying to access Solr admin installed on Glassfish

I've installed Solr 3.1 on Glassfish, and that part passed smoothly, as when I visit<host>:<port>/solr, I get that "Welcome to Solr!" page, along with "Solr Admin" link.
Problems start when I try to opet admin panel, I get "HTTP Status 404 - missing core name in path". I have no clue why is that happening. Previously, I've been testing that default Solr example (single core) at localhost, but using Jetty, shipped with Solr release in form of that start.jar.
I've set system property solr.solr.home to point to the folder where solr.xml and conf folder is located, and here's the content of mentioned solr.xml:
<solr persistent="false"
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
</cores>
</solr>
As you can see, just simple single core setup.
Any idea?
Thanks in advance
<solr persistent="false"
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="collection1" />
</cores>
</solr>
and a directory structure of:
collection1 (containing dirs, conf and data)
solr.xml
is the proper way to do it.

Resources