You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Yonik Seeley <yo...@apache.org> on 2006/10/02 22:32:31 UTC

Re: [Newbie] Solr Setup

On 10/2/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> Hi everyone, i just discovered Solr and tried to setup today but without
> any success altough i read many of previous posts in the mailing list...
> I did what i was supposed to do namely:
> * Install jdk 1.5 (on ubuntu)
> * Install tomcat
> * Copied solr.war in webapps where solr directory was copied afterwards
> * I also created Tomcat context fragments because i want to search
> different tables (in rdbms terms)
>
> So when i try to visit myserver:8080/solr i get a 404 while when i try
> to visit myserver:8080/solr/admin i get about 4-5 exceptions

Most likely you are seeing a failure of Solr to find the solr home
(and the associated solrconfig.xml and schema.xml files).

Have you tried the bundled version?  See
http://incubator.apache.org/solr/tutorial.html

To debug the Tomcat setup further, look in the Tomcat logs and see
what the first Exception is.

-Yonik

Re: [Newbie] Solr Setup

Posted by Yonik Seeley <yo...@apache.org>.
On 10/2/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> I ve have alreay followed the instructions for Tomcat installatin from
> wiki but no success but i have not executed the self contained demo... I
> try to execute it but is asks from Admin authorization on my win
> laptop... And i cannot figure why it does so ?

Hmmm, that's a new one.  What's the exact message?  I've never tried
running Solr on windows with an id w/o admin privileges...

The self contained demo should also work on your linux box... try it there.

-Yonik

Re: [Newbie] Solr Setup

Posted by Yonik Seeley <yo...@apache.org>.
On 10/3/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> but it plays on Linux so i ll focus on that...
> So my question now it will be if i can modify the example to server my
> needs ... As i said i want to index 4 tables so i ll have to run 4
> instances of the same example ? Starting 4 Jettys or there is any
> smarter way ?

It depends on the size of the tables.
You can use a single schema for all the tables if you want.  If they
are large enough, it's probably advisable to put them in separate
servlets or servers.

-Yonik

Re: [Newbie] Solr Setup

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
but it plays on Linux so i ll focus on that...
So my question now it will be if i can modify the example to server my 
needs ... As i said i want to index 4 tables so i ll have to run 4 
instances of the same example ? Starting 4 Jettys or there is any 
smarter way ?

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: [Newbie] Solr Setup

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
besides the admin module that thorws an exception (i ll post it later 
on) when i try to visit solr or solr_p solr_r (as i have configured in 
context fragments) i always get 404

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: [Newbie] Solr Setup

Posted by Joachim Martin <jm...@path-works.com>.
If you have deployed solr as a root application, tomcat may be getting 
confused with the /admin/ url, thinking that it is the tomcat 
administration app.

If you have it deployed, I would rename the /admin/ app to be /tadmin/ 
or something to distinguish from the solr /admin/ directory.

--Joachim

Panayiotis Papadopoulos wrote:

> It prompts for HTTP authorization asking for password for Admin Realm
>
> ____________________________________________________________________
> http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
> http://www.freemail.gr - free email service for the Greek-speaking.



Re: [Newbie] Solr Setup

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
It prompts for HTTP authorization asking for password for Admin Realm

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: I think i got right...

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
According to this example:

<Context docBase="f:/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String" value="f:/solr1home" override="true" />
</Context>

it seems that it does not matter but i also put it in webapps
besides in the wiki it says that when u use fragments it says clearly:

" Don't put anything related to solr under the webapps directory. "




____________________________________________________________________
http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: I think i got right...

Posted by Bill Au <bi...@gmail.com>.
solar.war should be copied into the webapps directory, not lib.

Bill

On 10/3/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
>
> Hi there again, sorry for bugging you once more...
> So i executed the bandled example and know i did the following in Tomcat
> once again:
>
> * Tomcat is set correctly and there is not solr/ neither solr.war in
> webapps
> * I copied solr.war in /lib/solr.war
> * As the tutorial says i created
> $CATALINA_HOME/conf/Catalina/localhost/solr.xml, its conent
>
> <Context docBase="/lib/solr.war" debug="0" crossContext="true" >
>    <Environment name="solr/home" type="java.lang.String"
> value="/var/solr/solr" override="true" />
> </Context>
>
> * I also created the dir var/solr/solr by copying the solr directory
> from the example
> the var/solr/solr contains bin/ conf/ data/  i chwon to tomcat5 and
> chgrp to www-data but still i get 404
>
>
> PS i have also created the entries for solr_r , solr_rg , solr_p ,
> solr_o which other the instances i want to use
>
>
> ____________________________________________________________________
> http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
> http://www.freemail.gr - free email service for the Greek-speaking.
>

Re: index different doc types

Posted by Yonik Seeley <yo...@apache.org>.
Documents can be "sparse".... not all documents need to have the same fields.

For Solr overwriting adds and delete-by-id functionality, you
currently need a single "id" field though.

If using a single id field could cause collisions (say if there is a
researcher id=1 and a project id=1), then simply put the type in the
id also.

So one way would be:

id:researcher_1
type:researcher
name:george
...

id:project_1
type:project
projname:fusion reactor
...

But sometimes flattening (denormalizing) the data is the best way to
go for a search engine.  You combine the related tables into a single
document schema like so:

id:1
name:fusion reactor
researcher: george
researcher: mark
researcher dan

Then it makes it straightforward to formulate queries like:
  - What projects does george work on:  q=researcher:george
  - What projects does george work on with fusion in the name:
q=+researcher:george +name:fusion
 - What are all the projects with reactor in the name: q=name:reactor
  - What projects do both dan and mark work on together:
q=+researcher:mark +researcher:dan

-Yonik

On 10/4/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> So Chris let 's assume i use the bundled example with jetty... I could
> clean up the index there is the example and start my own ...
> In that case i just send different doc types and it is done ? Cos if
> remember well all docs have an <id> field or i can add an extra field
> like <researcher>y</researcher>,
> <project>y</project> ...
> So when i ll be doind my search i could just add ot my query
> /solr/project=y... or smth like that ?
> Besides that i have to use the field id or i can rename to r_id and p_id
> and so on ???
> If that works then i can use the bundled example as i can start it up
> easily and i could jetty instead of tomcat cos all i want from java is
> solr...
>

index different doc types

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
So Chris let 's assume i use the bundled example with jetty... I could 
clean up the index there is the example and start my own ...
In that case i just send different doc types and it is done ? Cos if 
remember well all docs have an <id> field or i can add an extra field 
like <researcher>y</researcher>,
<project>y</project> ...
So when i ll be doind my search i could just add ot my query 
/solr/project=y... or smth like that ?
Besides that i have to use the field id or i can rename to r_id and p_id 
and so on ???
If that works then i can use the bundled example as i can start it up 
easily and i could jetty instead of tomcat cos all i want from java is 
solr...

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: I think i got right...

Posted by Chris Hostetter <ho...@fucit.org>.
: if everything fails then i guess i cna modify the bundled example but in
: that case how i can index 4 different xml docs, i ll have to run 4
: jettys/solr ?

1) as yonik said, you can index different types of documents in one Solr
index if you want, or you can run 4 seperate instances -- it's entirely up
to you.

2) the important thing is to get one instance of solr up and running in
your container (tomcat) using the solr.war as is and the example configs
-- until you've done that, worrying about multiple instances or
modifying the configs, or customizing hte code in the war is premature.


one foot in front of the other and all that.



-Hoss


Re: I think i got right...

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
ok the i will try everything related to Tomcat permission and i would 
tell you
if everything fails then i guess i cna modify the bundled example but in 
that case how i can index 4 different xml docs, i ll have to run 4 
jettys/solr ?

anyway i really really want to thank you because u have done quite a 
procedure for me
thanx !

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: I think i got right...

Posted by Yonik Seeley <yo...@apache.org>.
On 10/3/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> It is not bundled tomcat. I have downloaded form apache jakarta site,
> the version i use is 5.5.20

OK, I just tried tomcat 5.5.20 on my windows/cygwin box with a context
fragment, and it worked fine for me.

What I did:
1) download and unzip tomcat 5.5.20
2) put a solr.xml context fragment that points to the war and config
from the bundled example:

Yonik@spidey /cygdrive/f/opt/tomcat5520
$ cat conf/Catalina/localhost/solr.xml
<Context docBase="f:/code/solr/example/webapps/solr.war" debug="0" crossContext=
"true" >
   <Environment name="solr/home" type="java.lang.String"
value="f:/code/solr/example/solr" override="true" />
</Context>

3) start tomcat via "bin/startup.sh"
4) open browser at http://localhost:8080/solr/admin/

For you, it looks like that Solr is finding all the config fine.  The
problem looks like an environment/tomcat config problem.  The
exception you list makes it look like tomcat can't compile the JSPs
into classes for some reason.

> java.io.FileNotFoundException: /usr/lib/apache-tomcat-5.5.20/work/Catalina/localhost/solr/org/apache/jsp/admin/index_jsp.java (No such file or directory)
>

Perhaps a simple file permissions problem?
I assume you are trying to run Tomcat as the same user you unpacked it as?
Maybe try chmod -R a+rwx
/usr/lib/apache-tomcat-5.5.20/

It might also be an environment problem... try unsetting any
environment variable name with CATALINA as part of it's name.

I'd also start off with a single context fragment to make things
simpler, but that doesn't look like it's the problem.

-Yonik

Re: I think i got right...

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
It is not bundled tomcat. I have downloaded form apache jakarta site, 
the version i use is 5.5.20

So the excpetions i get are:

When i try to visit solr/admin or solr_r/admin or one of the other as i 
have configured i get:

java.io.FileNotFoundException: /usr/lib/apache-tomcat-5.5.20/work/Catalina/localhost/solr/org/apache/jsp/admin/index_jsp.java (No such file or directory)

when i try to visit solr i get 404

in the logs
the localhost log  gives me: 
	
SEVERE: Servlet /solr threw load() exception
java.lang.NoClassDefFoundError

Catalina log seems fine:
3 Οκτ 2006 1:31:18 μμ org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.20
3 Οκτ 2006 1:31:18 μμ org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
3 Οκτ 2006 1:31:19 μμ org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive solr.war
3 Οκτ 2006 1:31:19 μμ org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init()
3 Οκτ 2006 1:31:19 μμ org.apache.solr.servlet.SolrServlet init
INFO: No /solr/home in JNDI
3 Οκτ 2006 1:31:19 μμ org.apache.solr.servlet.SolrServlet init
INFO: user.dir=/usr/lib/apache-tomcat-5.5.20
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.Config getInstanceDir
INFO: Solr home defaulted to 'solr/'
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.SolrConfig initConfig
INFO: Loaded SolrConfig: solrconfig.xml
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler standard=solr.StandardRequestHandler
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler dismax=solr.DisMaxRequestHandler
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler partitioned=solr.DisMaxRequestHandler
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.RequestHandlers <init>
INFO: adding requestHandler instock=solr.DisMaxRequestHandler
3 Οκτ 2006 1:31:19 μμ org.apache.solr.core.SolrCore <init>
INFO: Opening new SolrCore at solr/, dataDir=solr/data
3 Οκτ 2006 1:31:19 μμ org.apache.solr.schema.IndexSchema readConfig
INFO: Reading Solr Schema
3 Οκτ 2006 1:31:19 μμ org.apache.solr.schema.IndexSchema readConfig
INFO: Schema name=example
3 Οκτ 2006 1:31:20 μμ org.apache.solr.schema.IndexSchema readConfig
INFO: default search field is text
3 Οκτ 2006 1:31:20 μμ org.apache.solr.schema.IndexSchema readConfig
INFO: query parser default operator is OR
3 Οκτ 2006 1:31:20 μμ org.apache.solr.schema.IndexSchema readConfig
INFO: unique key field: id
3 Οκτ 2006 1:31:20 μμ org.apache.solr.core.SolrCore parseListener
INFO: Searching for listeners: //listener[@event="firstSearcher"]
3 Οκτ 2006 1:31:20 μμ org.apache.solr.core.SolrCore parseListener
INFO: Searching for listeners: //listener[@event="newSearcher"]


That 's all, it seems very strange since catalina log seems perfect

____________________________________________________________________
http://www.freemail.gr - ������ �������� ������������ ������������.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: I think i got right...

Posted by Yonik Seeley <yo...@apache.org>.
On 10/3/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> Hi there again, sorry for bugging you once more...
> So i executed the bandled example and know i did the following in Tomcat
> once again:
>
> * Tomcat is set correctly and there is not solr/ neither solr.war in webapps
> * I copied solr.war in /lib/solr.war
> * As the tutorial says i created
> $CATALINA_HOME/conf/Catalina/localhost/solr.xml, its conent
>
> <Context docBase="/lib/solr.war" debug="0" crossContext="true" >
>    <Environment name="solr/home" type="java.lang.String"
> value="/var/solr/solr" override="true" />
> </Context>
>
> * I also created the dir var/solr/solr by copying the solr directory
> from the example
> the var/solr/solr contains bin/ conf/ data/  i chwon to tomcat5 and
> chgrp to www-data but still i get 404

It looks like you did everything correctly.
So you get a 404 trying a solr/admin url?

I assume you are trying to use the tomcat bundled with your OS?
Since I don't know how thats configured, try downloading your own
Tomcat as shown in http://wiki.apache.org/solr/SolrTomcat under
"Example Install"

If that still fails, look in the log files and look for the first
exception you see.

-Yonik

I think i got right...

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
Hi there again, sorry for bugging you once more...
So i executed the bandled example and know i did the following in Tomcat 
once again:

* Tomcat is set correctly and there is not solr/ neither solr.war in webapps
* I copied solr.war in /lib/solr.war
* As the tutorial says i created 
$CATALINA_HOME/conf/Catalina/localhost/solr.xml, its conent

<Context docBase="/lib/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String" 
value="/var/solr/solr" override="true" />
</Context>

* I also created the dir var/solr/solr by copying the solr directory 
from the example
the var/solr/solr contains bin/ conf/ data/  i chwon to tomcat5 and 
chgrp to www-data but still i get 404


PS i have also created the entries for solr_r , solr_rg , solr_p , 
solr_o which other the instances i want to use


____________________________________________________________________
http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: [Newbie] Solr Setup

Posted by Nick Snels <ni...@gmail.com>.
I have Solr with Tomcat installed on a CentOS box. I had to place the Solr
map, with the bin and conf maps inside under /home/tomcat/ and chown
tomcat:tomcat /home/tomcat/solr and then Tomcat can find Solr home and the
errors should be gone.

Kind regards,

Nick


On 10/3/06, WHIRLYCOTT <ph...@whirlycott.com> wrote:
>
> It's not asking for admin privs on your laptop.  Or it shouldn't be,
> at least.  What exactly is asking for admin rights?
>
> phil.
>
> On Oct 2, 2006, at 6:11 PM, Panayiotis Papadopoulos wrote:
>
> > I ve have alreay followed the instructions for Tomcat installatin
> > from wiki but no success but i have not executed the self contained
> > demo... I try to execute it but is asks from Admin authorization on
> > my win laptop... And i cannot figure why it does so ? Or where
> > should i change the user and pass ??
> > Sorry for the lots of questions... Hope one day i can anwser more
> > than question more on this list
> >
> > ____________________________________________________________________
> > http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
> > http://www.freemail.gr - free email service for the Greek-speaking.
>
>
> --
>                                     Whirlycott
>                                     Philip Jacob
>                                     phil@whirlycott.com
>                                     http://www.whirlycott.com/phil/
>
>
>

Re: [Newbie] Solr Setup

Posted by WHIRLYCOTT <ph...@whirlycott.com>.
It's not asking for admin privs on your laptop.  Or it shouldn't be,  
at least.  What exactly is asking for admin rights?

phil.

On Oct 2, 2006, at 6:11 PM, Panayiotis Papadopoulos wrote:

> I ve have alreay followed the instructions for Tomcat installatin  
> from wiki but no success but i have not executed the self contained  
> demo... I try to execute it but is asks from Admin authorization on  
> my win laptop... And i cannot figure why it does so ? Or where  
> should i change the user and pass ??
> Sorry for the lots of questions... Hope one day i can anwser more  
> than question more on this list
>
> ____________________________________________________________________
> http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
> http://www.freemail.gr - free email service for the Greek-speaking.


--
                                    Whirlycott
                                    Philip Jacob
                                    phil@whirlycott.com
                                    http://www.whirlycott.com/phil/



Re: [Newbie] Solr Setup

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
I ve have alreay followed the instructions for Tomcat installatin from 
wiki but no success but i have not executed the self contained demo... I 
try to execute it but is asks from Admin authorization on my win 
laptop... And i cannot figure why it does so ? Or where should i change 
the user and pass ??
Sorry for the lots of questions... Hope one day i can anwser more than 
question more on this list

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: [Newbie] Solr Setup

Posted by Yonik Seeley <yo...@apache.org>.
On 10/2/06, Panayiotis Papadopoulos <pa...@freemail.gr> wrote:
> I have understood thas solr home is not within the webapp directory but
> how do i tell tomcat where is it ?
> As i said i tried java -Dsolr.solr.home=/wherver/solr/could/be but
> without success?
> Does anyone know how i can do it usind JNDI or somehting else ?

There are three methods... JNDI, solr.solr.home, and ./solr

The example ContextFragments for Tomcat shown here show you how to do
it via JNDI:
http://wiki.apache.org/solr/SolrTomcat

<Context docBase="f:/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String"
value="f:/solr1home" override="true" />
</Context>

> Besides where should i put the schema and solconfig xmls ? Inside the
> solr webapp dir or solr home ? And should i put them just in solr
> directory or create a subdir solr/conf/

It sounds like you don't know what the solr home should look like.
As I said before, see solr_nightly/example/solr for an example solr
home with the conf and data directories.  Get things working with the
example configs and then change it to suit your needs.

-Yonik

Re: [Newbie] Solr Setup

Posted by Chris Hostetter <ho...@fucit.org>.
: Besides where should i put the schema and solconfig xmls ? Inside the
: solr webapp dir or solr home ? And should i put them just in solr
: directory or create a subdir solr/conf/

as yonik said, if you are new to Solr and having trouble getting setup ith
Tomcat, start by trying to use the self contained "example" demo that runs
under Jetty, and make sure you can execute all of the steps in the tutorial...

	http://incubator.apache.org/solr/tutorial.html

...if that works, then you can look at the "solr" dir in that example to
understand what a "solr" dir looks like, and what files live where.


Once you reach that point, the SolrTomcat wiki page has several examples
to help you get started using Tomcat -- including an 11 line example of
installing both Tomcat and Solr from scratch (since there may be some
funky configuration included in the ubuntu install of tomcat) and some
example context fragments to identify where the solr home should be ...
BUT: please don't try anything Tomcat specific until you've tried the self
contained example ... it's designed not only to make it easy to follow hte
tutorial, but also because it provides a consistent setup so that other
people on the list can help you anwer questions without needing to guess
what exactly you've done.



-Hoss


Re: [Newbie] Solr Setup

Posted by Panayiotis Papadopoulos <pa...@freemail.gr>.
I have understood thas solr home is not within the webapp directory but 
how do i tell tomcat where is it ?
As i said i tried java -Dsolr.solr.home=/wherver/solr/could/be but 
without success?

Does anyone know how i can do it usind JNDI or somehting else ?
Besides where should i put the schema and solconfig xmls ? Inside the 
solr webapp dir or solr home ? And should i put them just in solr 
directory or create a subdir solr/conf/

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

Re: [Newbie] Solr Setup

Posted by Yonik Seeley <yo...@apache.org>.
On 10/2/06, Yonik Seeley <yo...@apache.org> wrote:
> Most likely you are seeing a failure of Solr to find the solr home
> (and the associated solrconfig.xml and schema.xml files).

To clarify, the solr home is *not* where the solr webapp is.
It's where the solr index and solr config files live.  If you don't
configure it, it will default to ./solr
http://wiki.apache.org/solr/ConfiguringSolr

See solr/example/solr for an example Solr home.

-Yonik