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 Jacob Singh <ja...@gmail.com> on 2008/08/08 02:56:40 UTC

What is the variable in sfconfig.xml for solr home

I see in the docs:

System property substitution

Solr supports system property substitution, allowing the launching JVM
to specify string substitutions within either of Solr's configuration
files. The syntax ${property[:default value]}. Substitutions are valid
in any element or attribute text. Here's an example of allowing the
runtime to dictate the data directory:

   <dataDir>${solr.data.dir:./solr/data}</dataDir>


So what is the property for solr home?  I've tried solr.home,
solr.solr/home (from JNDI), solr.solrhome...

Thanks,
Jacob

P.S. is there a list of properties available somewhere?


Re: What is the variable in sfconfig.xml for solr home

Posted by Jacob Singh <ja...@gmail.com>.
Hi SHalin,

I'm using JNDI and to set the solr home via an override like so:

  <env-entry>
    <env-entry-name>solr/home</env-entry-name>
    <env-entry-value>path/to/solr/home</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
  </env-entry>


This works like a charm, and I have 20 instances which all link to the
same conf/ folder which has the solrconfig.xml

It's just that I don't think I need 20 solrconfig.xml files since they
are all identical except the section in question below.

Best,
Jacob

Shalin Shekhar Mangar wrote:
> Not sure why you are passing the args. If you are using the standard
> directory structure, it may not be needed.
> 
> Try removing the args and env sections and see. It works great for me that
> way.
> 
> On Fri, Aug 8, 2008 at 12:57 PM, Jacob Singh <ja...@gmail.com> wrote:
> 
>> Hi Shanlin,
>>
>> Thanks for your reply.
>>
>> I tried the following:
>> <listener event="postCommit" class="solr.RunExecutableListener">
>>      <str name="exe">/opt/solr/bin/snapshooter</str>
>>      <str name="dir">/opt/solr/bin</str>
>>      <bool name="wait">true</bool>
>>      <arr name="args"> <str>-d ${solr.solr.home:.}/data </str> </arr>
>>      <arr name="env"> <str>MYVAR=val1</str> </arr>
>>
>> in my solrconfig.xml
>>
>> but I always get the default (.).  I am using overrides through JNDI to
>> set solr/home and this works fine for everything, but it seems the
>> variable is not set here....  I'm testing it by putting a logging call
>> of $* in snapshooter, and it always receives -d ./data
>>
>> Do you have any idea what could be causing it?
>>
>> Best,
>> Jacob
>>
>> Shalin Shekhar Mangar wrote:
>>> You can set solr home by passing -Dsolr.solr.home=/path/to/solr/home when
>>> running your container (the double solr is *not* a typo)
>>>
>>> You can also use JNDI to configure it. Look under the "Installation and
>>> Configuration" section in the wiki for container-specific instructions:
>>> http://wiki.apache.org/solr/
>>>
>>> On Fri, Aug 8, 2008 at 6:26 AM, Jacob Singh <ja...@gmail.com>
>> wrote:
>>>> I see in the docs:
>>>>
>>>> System property substitution
>>>>
>>>> Solr supports system property substitution, allowing the launching JVM
>>>> to specify string substitutions within either of Solr's configuration
>>>> files. The syntax ${property[:default value]}. Substitutions are valid
>>>> in any element or attribute text. Here's an example of allowing the
>>>> runtime to dictate the data directory:
>>>>
>>>>   <dataDir>${solr.data.dir:./solr/data}</dataDir>
>>>>
>>>>
>>>> So what is the property for solr home?  I've tried solr.home,
>>>> solr.solr/home (from JNDI), solr.solrhome...
>>>>
>>>> Thanks,
>>>> Jacob
>>>>
>>>> P.S. is there a list of properties available somewhere?
>>>>
>>>>
>>>
>>
> 
> 


Re: What is the variable in sfconfig.xml for solr home

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Not sure why you are passing the args. If you are using the standard
directory structure, it may not be needed.

Try removing the args and env sections and see. It works great for me that
way.

On Fri, Aug 8, 2008 at 12:57 PM, Jacob Singh <ja...@gmail.com> wrote:

> Hi Shanlin,
>
> Thanks for your reply.
>
> I tried the following:
> <listener event="postCommit" class="solr.RunExecutableListener">
>      <str name="exe">/opt/solr/bin/snapshooter</str>
>      <str name="dir">/opt/solr/bin</str>
>      <bool name="wait">true</bool>
>      <arr name="args"> <str>-d ${solr.solr.home:.}/data </str> </arr>
>      <arr name="env"> <str>MYVAR=val1</str> </arr>
>
> in my solrconfig.xml
>
> but I always get the default (.).  I am using overrides through JNDI to
> set solr/home and this works fine for everything, but it seems the
> variable is not set here....  I'm testing it by putting a logging call
> of $* in snapshooter, and it always receives -d ./data
>
> Do you have any idea what could be causing it?
>
> Best,
> Jacob
>
> Shalin Shekhar Mangar wrote:
> > You can set solr home by passing -Dsolr.solr.home=/path/to/solr/home when
> > running your container (the double solr is *not* a typo)
> >
> > You can also use JNDI to configure it. Look under the "Installation and
> > Configuration" section in the wiki for container-specific instructions:
> > http://wiki.apache.org/solr/
> >
> > On Fri, Aug 8, 2008 at 6:26 AM, Jacob Singh <ja...@gmail.com>
> wrote:
> >
> >> I see in the docs:
> >>
> >> System property substitution
> >>
> >> Solr supports system property substitution, allowing the launching JVM
> >> to specify string substitutions within either of Solr's configuration
> >> files. The syntax ${property[:default value]}. Substitutions are valid
> >> in any element or attribute text. Here's an example of allowing the
> >> runtime to dictate the data directory:
> >>
> >>   <dataDir>${solr.data.dir:./solr/data}</dataDir>
> >>
> >>
> >> So what is the property for solr home?  I've tried solr.home,
> >> solr.solr/home (from JNDI), solr.solrhome...
> >>
> >> Thanks,
> >> Jacob
> >>
> >> P.S. is there a list of properties available somewhere?
> >>
> >>
> >
> >
>
>


-- 
Regards,
Shalin Shekhar Mangar.

Re: What is the variable in sfconfig.xml for solr home

Posted by Jacob Singh <ja...@gmail.com>.
Hi Shanlin,

Thanks for your reply.

I tried the following:
<listener event="postCommit" class="solr.RunExecutableListener">
      <str name="exe">/opt/solr/bin/snapshooter</str>
      <str name="dir">/opt/solr/bin</str>
      <bool name="wait">true</bool>
      <arr name="args"> <str>-d ${solr.solr.home:.}/data </str> </arr>
      <arr name="env"> <str>MYVAR=val1</str> </arr>

in my solrconfig.xml

but I always get the default (.).  I am using overrides through JNDI to
set solr/home and this works fine for everything, but it seems the
variable is not set here....  I'm testing it by putting a logging call
of $* in snapshooter, and it always receives -d ./data

Do you have any idea what could be causing it?

Best,
Jacob

Shalin Shekhar Mangar wrote:
> You can set solr home by passing -Dsolr.solr.home=/path/to/solr/home when
> running your container (the double solr is *not* a typo)
> 
> You can also use JNDI to configure it. Look under the "Installation and
> Configuration" section in the wiki for container-specific instructions:
> http://wiki.apache.org/solr/
> 
> On Fri, Aug 8, 2008 at 6:26 AM, Jacob Singh <ja...@gmail.com> wrote:
> 
>> I see in the docs:
>>
>> System property substitution
>>
>> Solr supports system property substitution, allowing the launching JVM
>> to specify string substitutions within either of Solr's configuration
>> files. The syntax ${property[:default value]}. Substitutions are valid
>> in any element or attribute text. Here's an example of allowing the
>> runtime to dictate the data directory:
>>
>>   <dataDir>${solr.data.dir:./solr/data}</dataDir>
>>
>>
>> So what is the property for solr home?  I've tried solr.home,
>> solr.solr/home (from JNDI), solr.solrhome...
>>
>> Thanks,
>> Jacob
>>
>> P.S. is there a list of properties available somewhere?
>>
>>
> 
> 


Re: What is the variable in sfconfig.xml for solr home

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
You can set solr home by passing -Dsolr.solr.home=/path/to/solr/home when
running your container (the double solr is *not* a typo)

You can also use JNDI to configure it. Look under the "Installation and
Configuration" section in the wiki for container-specific instructions:
http://wiki.apache.org/solr/

On Fri, Aug 8, 2008 at 6:26 AM, Jacob Singh <ja...@gmail.com> wrote:

> I see in the docs:
>
> System property substitution
>
> Solr supports system property substitution, allowing the launching JVM
> to specify string substitutions within either of Solr's configuration
> files. The syntax ${property[:default value]}. Substitutions are valid
> in any element or attribute text. Here's an example of allowing the
> runtime to dictate the data directory:
>
>   <dataDir>${solr.data.dir:./solr/data}</dataDir>
>
>
> So what is the property for solr home?  I've tried solr.home,
> solr.solr/home (from JNDI), solr.solrhome...
>
> Thanks,
> Jacob
>
> P.S. is there a list of properties available somewhere?
>
>


-- 
Regards,
Shalin Shekhar Mangar.