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 Damien Dykman <da...@gmail.com> on 2015/03/10 00:59:25 UTC

Solr 5.0.0 - Multiple instances sharing Solr server *read-only* dir

Hi all,

Quoted from
https://cwiki.apache.org/confluence/display/solr/Solr+Start+Script+Reference

"When running multiple instances of Solr on the same host, it is more
common to use the same server directory for each instance and use a
unique Solr home directory using the -s option."

Is there a way to achieve this without making *any* changes to the
extracted content of solr-5.0.0.tgz and only use runtime parameters? I
other words, make the extracted folder solr-5.0.0 strictly read-only?

By default, the Solr web app is deployed under server/solr-webapp, as
per solr-jetty-context.xml. So unless I change solr-jetty-context.xml, I
cannot make folder sorl-5.0.0 read-only to my Solr instances.

I've figured out how to make the log files and pid file to be located
under the Solr data dir by doing:

export SOLR_PID_DIR=mySolrDataDir/logs; \
export SOLR_LOGS_DIR=mySolrDataDir/logs; \
bin/solr start -c -z localhost:32101/solr \
     -s mySolrDataDir \
     -a "-Dsolr.log=mySolrDataDir/logs" \
     -p 31100 -h localhost

But if there was a way to not have to change solr-jetty-context.xml that
would be awesome! Thoughts?

Thanks,
Damien

Re: Solr 5.0.0 - Multiple instances sharing Solr server *read-only* dir

Posted by Damien Dykman <da...@gmail.com>.
Thanks Timothy for the pointer to the Jira ticket. That's exactly it :-)

Erick, the main reason why I would run multiple instances on the same
machine is to simulate a multi node environment. But beyond that, I like
the idea of being able to clearly separate the server dir and the data
dirs. That way the server dir could be deployed by root. Yet Solr
instances could run in userland.

Damien

On 03/10/2015 09:31 AM, Timothy Potter wrote:
> I think the next step here is to ship Solr with the war already extracted
> so that Jetty doesn't need to extract it on first startup -
> https://issues.apache.org/jira/browse/SOLR-7227
>
> On Tue, Mar 10, 2015 at 10:15 AM, Erick Erickson <er...@gmail.com>
> wrote:
>
>> If I'm understanding your problem correctly, I think you want the -d
>> option,
>> then all the -s guys would be under that.
>>
>> Just to check, though, why are you running multiple Solrs? There are
>> sometimes
>> very good reasons, just checking that you're not making things more
>> difficult
>> than necessary....
>>
>> Best,
>> Erick
>>
>> On Mon, Mar 9, 2015 at 4:59 PM, Damien Dykman <da...@gmail.com>
>> wrote:
>>> Hi all,
>>>
>>> Quoted from
>>>
>> https://cwiki.apache.org/confluence/display/solr/Solr+Start+Script+Reference
>>> "When running multiple instances of Solr on the same host, it is more
>>> common to use the same server directory for each instance and use a
>>> unique Solr home directory using the -s option."
>>>
>>> Is there a way to achieve this without making *any* changes to the
>>> extracted content of solr-5.0.0.tgz and only use runtime parameters? I
>>> other words, make the extracted folder solr-5.0.0 strictly read-only?
>>>
>>> By default, the Solr web app is deployed under server/solr-webapp, as
>>> per solr-jetty-context.xml. So unless I change solr-jetty-context.xml, I
>>> cannot make folder sorl-5.0.0 read-only to my Solr instances.
>>>
>>> I've figured out how to make the log files and pid file to be located
>>> under the Solr data dir by doing:
>>>
>>> export SOLR_PID_DIR=mySolrDataDir/logs; \
>>> export SOLR_LOGS_DIR=mySolrDataDir/logs; \
>>> bin/solr start -c -z localhost:32101/solr \
>>>      -s mySolrDataDir \
>>>      -a "-Dsolr.log=mySolrDataDir/logs" \
>>>      -p 31100 -h localhost
>>>
>>> But if there was a way to not have to change solr-jetty-context.xml that
>>> would be awesome! Thoughts?
>>>
>>> Thanks,
>>> Damien


Re: Solr 5.0.0 - Multiple instances sharing Solr server *read-only* dir

Posted by Timothy Potter <th...@gmail.com>.
I think the next step here is to ship Solr with the war already extracted
so that Jetty doesn't need to extract it on first startup -
https://issues.apache.org/jira/browse/SOLR-7227

On Tue, Mar 10, 2015 at 10:15 AM, Erick Erickson <er...@gmail.com>
wrote:

> If I'm understanding your problem correctly, I think you want the -d
> option,
> then all the -s guys would be under that.
>
> Just to check, though, why are you running multiple Solrs? There are
> sometimes
> very good reasons, just checking that you're not making things more
> difficult
> than necessary....
>
> Best,
> Erick
>
> On Mon, Mar 9, 2015 at 4:59 PM, Damien Dykman <da...@gmail.com>
> wrote:
> > Hi all,
> >
> > Quoted from
> >
> https://cwiki.apache.org/confluence/display/solr/Solr+Start+Script+Reference
> >
> > "When running multiple instances of Solr on the same host, it is more
> > common to use the same server directory for each instance and use a
> > unique Solr home directory using the -s option."
> >
> > Is there a way to achieve this without making *any* changes to the
> > extracted content of solr-5.0.0.tgz and only use runtime parameters? I
> > other words, make the extracted folder solr-5.0.0 strictly read-only?
> >
> > By default, the Solr web app is deployed under server/solr-webapp, as
> > per solr-jetty-context.xml. So unless I change solr-jetty-context.xml, I
> > cannot make folder sorl-5.0.0 read-only to my Solr instances.
> >
> > I've figured out how to make the log files and pid file to be located
> > under the Solr data dir by doing:
> >
> > export SOLR_PID_DIR=mySolrDataDir/logs; \
> > export SOLR_LOGS_DIR=mySolrDataDir/logs; \
> > bin/solr start -c -z localhost:32101/solr \
> >      -s mySolrDataDir \
> >      -a "-Dsolr.log=mySolrDataDir/logs" \
> >      -p 31100 -h localhost
> >
> > But if there was a way to not have to change solr-jetty-context.xml that
> > would be awesome! Thoughts?
> >
> > Thanks,
> > Damien
>

Re: Solr 5.0.0 - Multiple instances sharing Solr server *read-only* dir

Posted by Erick Erickson <er...@gmail.com>.
If I'm understanding your problem correctly, I think you want the -d option,
then all the -s guys would be under that.

Just to check, though, why are you running multiple Solrs? There are sometimes
very good reasons, just checking that you're not making things more difficult
than necessary....

Best,
Erick

On Mon, Mar 9, 2015 at 4:59 PM, Damien Dykman <da...@gmail.com> wrote:
> Hi all,
>
> Quoted from
> https://cwiki.apache.org/confluence/display/solr/Solr+Start+Script+Reference
>
> "When running multiple instances of Solr on the same host, it is more
> common to use the same server directory for each instance and use a
> unique Solr home directory using the -s option."
>
> Is there a way to achieve this without making *any* changes to the
> extracted content of solr-5.0.0.tgz and only use runtime parameters? I
> other words, make the extracted folder solr-5.0.0 strictly read-only?
>
> By default, the Solr web app is deployed under server/solr-webapp, as
> per solr-jetty-context.xml. So unless I change solr-jetty-context.xml, I
> cannot make folder sorl-5.0.0 read-only to my Solr instances.
>
> I've figured out how to make the log files and pid file to be located
> under the Solr data dir by doing:
>
> export SOLR_PID_DIR=mySolrDataDir/logs; \
> export SOLR_LOGS_DIR=mySolrDataDir/logs; \
> bin/solr start -c -z localhost:32101/solr \
>      -s mySolrDataDir \
>      -a "-Dsolr.log=mySolrDataDir/logs" \
>      -p 31100 -h localhost
>
> But if there was a way to not have to change solr-jetty-context.xml that
> would be awesome! Thoughts?
>
> Thanks,
> Damien