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 Tom Evans <te...@googlemail.com> on 2015/03/24 17:00:23 UTC

Setting up SOLR 5 from an RPM

Hi all

We're migrating to SOLR 5 (from 4.8), and our infrastructure guys
would prefer we installed SOLR from an RPM rather than extracting the
tarball where we need it. They are creating the RPM file themselves,
and it installs an init.d script and the equivalent of the tarball to
/opt/solr.

We're having problems running SOLR from the installed files, as SOLR
wants to (I think) extract the WAR file and create various temporary
files below /opt/solr/server.

We currently have this structure:

/data/solr - root directory of our solr instance
/data/solr/{logs,run} - log/run directories
/data/solr/cores - configuration for our cores and solr.in.sh
/opt/solr - the RPM installed solr 5

The user running solr can modify anything under /data/solr, but
nothing under /opt/solr.

Is this sort of configuration supported? Am I missing some variable in
our solr.in.sh that sets where temporary files can be extracted? We
currently set:

    SOLR_PID_DIR=/data/solr/run
    SOLR_HOME=/data/solr/cores
    SOLR_LOGS_DIR=/data/solr/logs


Cheers

Tom

Re: Setting up SOLR 5 from an RPM

Posted by Tom Evans <te...@googlemail.com>.
On Wed, Mar 25, 2015 at 2:40 PM, Shawn Heisey <ap...@elyograg.org> wrote:
> I think you will only need to change the ownership of the solr home and
> the location where the .war file is extracted, which by default is
> server/solr-webapp.  The user must be able to *read* the program data,
> but should not need to write to it. If you are using the start script
> included with Solr 5 and one of the examples, I believe the logging
> destination will also be located under the solr home, but you should
> make sure that's the case.


Thanks Shawn, this sort of makes sense. The thing which I cannot seem
to do is change the location where the war file is extracted. I think
this is probably because, as of solr 5, I am not supposed to know or
be aware that there is a war file, or that the war file is hosted in
jetty, which makes it tricky to specify the jetty temporary directory.

Our use case is that we want to create a single system image that
would be usable for several projects, each project would check out its
solr home and run solr as their own user (possibly on the same
server). Eg, /data/projectA being a solr home for one project,
/data/projectB being a solr home for another project, both running
solr from the same location.

Also, on a dev server, I want to install solr once, and each member of
my team run it from that single location. Because they cannot change
the temporary directory, and they cannot all own server/solr-webapp,
this does not work and they must each have their own copy of the solr
install.

I think the way we will go for this is in production to run all our
solr instance as the "solr" user, who will own the files in /opt/solr,
and have their solr home directory wherever they choose. In dev, we
will just do something...

Cheers

Tom

Re: Setting up SOLR 5 from an RPM

Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/25/2015 5:49 AM, Tom Evans wrote:
> On Tue, Mar 24, 2015 at 4:00 PM, Tom Evans <te...@googlemail.com> wrote:
>> Hi all
>>
>> We're migrating to SOLR 5 (from 4.8), and our infrastructure guys
>> would prefer we installed SOLR from an RPM rather than extracting the
>> tarball where we need it. They are creating the RPM file themselves,
>> and it installs an init.d script and the equivalent of the tarball to
>> /opt/solr.
>>
>> We're having problems running SOLR from the installed files, as SOLR
>> wants to (I think) extract the WAR file and create various temporary
>> files below /opt/solr/server.
> 
> From the SOLR 5 reference guide, section "Managing SOLR", sub-section
> "Taking SOLR to production", it seems changing the ownership of the
> installed files to the user that will run SOLR is an explicit
> requirement if you do not wish to run as root.
> 
> It would be better if this was not required. With most applications
> you do not normally require permission to modify the installed files
> in order to run the application, eg I do not need write permission to
> /usr/share/vim to run vim, it is a shame I need write permission to
> /opt/solr to run solr.

I think you will only need to change the ownership of the solr home and
the location where the .war file is extracted, which by default is
server/solr-webapp.  The user must be able to *read* the program data,
but should not need to write to it. If you are using the start script
included with Solr 5 and one of the examples, I believe the logging
destination will also be located under the solr home, but you should
make sure that's the case.

Thanks,
Shawn


Re: Setting up SOLR 5 from an RPM

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Mar 24, 2015 at 4:00 PM, Tom Evans <te...@googlemail.com> wrote:
> Hi all
>
> We're migrating to SOLR 5 (from 4.8), and our infrastructure guys
> would prefer we installed SOLR from an RPM rather than extracting the
> tarball where we need it. They are creating the RPM file themselves,
> and it installs an init.d script and the equivalent of the tarball to
> /opt/solr.
>
> We're having problems running SOLR from the installed files, as SOLR
> wants to (I think) extract the WAR file and create various temporary
> files below /opt/solr/server.

>From the SOLR 5 reference guide, section "Managing SOLR", sub-section
"Taking SOLR to production", it seems changing the ownership of the
installed files to the user that will run SOLR is an explicit
requirement if you do not wish to run as root.

It would be better if this was not required. With most applications
you do not normally require permission to modify the installed files
in order to run the application, eg I do not need write permission to
/usr/share/vim to run vim, it is a shame I need write permission to
/opt/solr to run solr.

Cheers

Tom