Re: User-defined properties and configsets

2016-01-31 Thread Erick Erickson
Ah,OK. There's no mechanism that I know of for that.

I'd guess system properties wouldn't even work as two cores in the
same JVM would potentially want different values for the same embedded
system variable if they used different configsets.

So I think you're stuck at present with specifying the properties at
core creation time. I can imagine scripts that read your common
properties file and auto generate the CREATE call, but that would be
custom...

Best,
Erick

On Sun, Jan 31, 2016 at 3:36 AM, Georg Sorst  wrote:
> Erick Erickson  schrieb am Fr., 29. Jan. 2016 um
> 17:55 Uhr:
>
>> These are system properties, right? They go in the startup for all of
>> your Solr instances scattered about your cluster.
>>
>
> No, they will be used in the solrconfig.xml and schema.xml. I just
> mentioned the -Dmyproperty=... example because that's one way to get
> properties in there.
>
> What I'm looking for is one concise place to define properties that all
> cores using this configset will use as a default. I've tried several ways:
>
> * Using the ${property:default} syntax in the configs is no good, because
> the same property will occur several times in the configs
> * Setting them with the config API is no good, because then they live in my
> code, but I'd rather have them in a property file for visiblity and
> maintenance reasons
> * Setting them as system properties (-Dmyproperty=...) is no good, because
> that makes our deployment more complicated
>
> So, ideally I can just put a .properties file in the configset that will
> provide default values for all cores using this configset.
>
> Of course the properties may be changed from their default values on a
> per-core base, but that's what the config API is for.
>
> So, where do other people put their properties when they use configsets?
>
> Best regards,
> Georg
>
>
>>
>> The bin/solr script has a -a option for passing additional stuff to the
>> JVM...
>>
>> Best,
>> Erick
>>
>> On Thu, Jan 28, 2016 at 11:50 PM, Georg Sorst 
>> wrote:
>> > Any takers?
>> >
>> > Georg Sorst  schrieb am So., 24. Jän. 2016
>> 00:22:
>> >
>> >> Hi list!
>> >>
>> >> I've just started playing with Solr 5 (upgrading from Solr 4) and want
>> to
>> >> use configsets. I'm currently struggling with how to use user-defined
>> >> properties and configsets together.
>> >>
>> >> My solrconfig.xml contains a few properties. Previously these were in a
>> >> solrcore.properties and thus were properly loaded and substituted by
>> Solr.
>> >>
>> >> Now I've moved my configuration to a configset (as I may need to create
>> >> several cores with the same config). When I create a core with
>> >>
>> http://localhost:8983/solr/admin/cores?action=CREATE&name=mycore&configSet=myconfigset
>> Solr
>> >> tells me:
>> >>
>> >> Caused by: org.apache.solr.common.SolrException: Error loading solr
>> config
>> >> from //configsets/myconfigset/conf/solrconfig.xml
>> >> at
>> >>
>> org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:186)
>> >> at
>> >>
>> org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:94)
>> >> at
>> >>
>> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
>> >> ... 30 more
>> >> Caused by: org.apache.solr.common.SolrException: No system property or
>> >> default value specified for  value:
>> >> 
>> >> at
>> >>
>> org.apache.solr.util.PropertiesUtil.substituteProperty(PropertiesUtil.java:66)
>> >> ...
>> >>
>> >> Where should I put my properties so Solr can load them when I create a
>> new
>> >> core using this config set? From what I read I could specify them as
>> system
>> >> properties (-Dmyproperty=...) but I'd rather keep them in a file that I
>> can
>> >> check in.
>> >>
>> >> Thanks!
>> >> Georg
>> >>
>> >>
>> >>
>>


Re: User-defined properties and configsets

2016-01-31 Thread Georg Sorst
Erick Erickson  schrieb am Fr., 29. Jan. 2016 um
17:55 Uhr:

> These are system properties, right? They go in the startup for all of
> your Solr instances scattered about your cluster.
>

No, they will be used in the solrconfig.xml and schema.xml. I just
mentioned the -Dmyproperty=... example because that's one way to get
properties in there.

What I'm looking for is one concise place to define properties that all
cores using this configset will use as a default. I've tried several ways:

* Using the ${property:default} syntax in the configs is no good, because
the same property will occur several times in the configs
* Setting them with the config API is no good, because then they live in my
code, but I'd rather have them in a property file for visiblity and
maintenance reasons
* Setting them as system properties (-Dmyproperty=...) is no good, because
that makes our deployment more complicated

So, ideally I can just put a .properties file in the configset that will
provide default values for all cores using this configset.

Of course the properties may be changed from their default values on a
per-core base, but that's what the config API is for.

So, where do other people put their properties when they use configsets?

Best regards,
Georg


>
> The bin/solr script has a -a option for passing additional stuff to the
> JVM...
>
> Best,
> Erick
>
> On Thu, Jan 28, 2016 at 11:50 PM, Georg Sorst 
> wrote:
> > Any takers?
> >
> > Georg Sorst  schrieb am So., 24. Jän. 2016
> 00:22:
> >
> >> Hi list!
> >>
> >> I've just started playing with Solr 5 (upgrading from Solr 4) and want
> to
> >> use configsets. I'm currently struggling with how to use user-defined
> >> properties and configsets together.
> >>
> >> My solrconfig.xml contains a few properties. Previously these were in a
> >> solrcore.properties and thus were properly loaded and substituted by
> Solr.
> >>
> >> Now I've moved my configuration to a configset (as I may need to create
> >> several cores with the same config). When I create a core with
> >>
> http://localhost:8983/solr/admin/cores?action=CREATE&name=mycore&configSet=myconfigset
> Solr
> >> tells me:
> >>
> >> Caused by: org.apache.solr.common.SolrException: Error loading solr
> config
> >> from //configsets/myconfigset/conf/solrconfig.xml
> >> at
> >>
> org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:186)
> >> at
> >>
> org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:94)
> >> at
> >>
> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
> >> ... 30 more
> >> Caused by: org.apache.solr.common.SolrException: No system property or
> >> default value specified for  value:
> >> 
> >> at
> >>
> org.apache.solr.util.PropertiesUtil.substituteProperty(PropertiesUtil.java:66)
> >> ...
> >>
> >> Where should I put my properties so Solr can load them when I create a
> new
> >> core using this config set? From what I read I could specify them as
> system
> >> properties (-Dmyproperty=...) but I'd rather keep them in a file that I
> can
> >> check in.
> >>
> >> Thanks!
> >> Georg
> >>
> >>
> >>
>


Re: User-defined properties and configsets

2016-01-29 Thread Erick Erickson
These are system properties, right? They go in the startup for all of
your Solr instances scattered about your cluster.

The bin/solr script has a -a option for passing additional stuff to the JVM...

Best,
Erick

On Thu, Jan 28, 2016 at 11:50 PM, Georg Sorst  wrote:
> Any takers?
>
> Georg Sorst  schrieb am So., 24. Jän. 2016 00:22:
>
>> Hi list!
>>
>> I've just started playing with Solr 5 (upgrading from Solr 4) and want to
>> use configsets. I'm currently struggling with how to use user-defined
>> properties and configsets together.
>>
>> My solrconfig.xml contains a few properties. Previously these were in a
>> solrcore.properties and thus were properly loaded and substituted by Solr.
>>
>> Now I've moved my configuration to a configset (as I may need to create
>> several cores with the same config). When I create a core with
>> http://localhost:8983/solr/admin/cores?action=CREATE&name=mycore&configSet=myconfigset
>>  Solr
>> tells me:
>>
>> Caused by: org.apache.solr.common.SolrException: Error loading solr config
>> from //configsets/myconfigset/conf/solrconfig.xml
>> at
>> org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:186)
>> at
>> org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:94)
>> at
>> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
>> ... 30 more
>> Caused by: org.apache.solr.common.SolrException: No system property or
>> default value specified for  value:
>> 
>> at
>> org.apache.solr.util.PropertiesUtil.substituteProperty(PropertiesUtil.java:66)
>> ...
>>
>> Where should I put my properties so Solr can load them when I create a new
>> core using this config set? From what I read I could specify them as system
>> properties (-Dmyproperty=...) but I'd rather keep them in a file that I can
>> check in.
>>
>> Thanks!
>> Georg
>>
>>
>>


Re: User-defined properties and configsets

2016-01-28 Thread Georg Sorst
Any takers?

Georg Sorst  schrieb am So., 24. Jän. 2016 00:22:

> Hi list!
>
> I've just started playing with Solr 5 (upgrading from Solr 4) and want to
> use configsets. I'm currently struggling with how to use user-defined
> properties and configsets together.
>
> My solrconfig.xml contains a few properties. Previously these were in a
> solrcore.properties and thus were properly loaded and substituted by Solr.
>
> Now I've moved my configuration to a configset (as I may need to create
> several cores with the same config). When I create a core with
> http://localhost:8983/solr/admin/cores?action=CREATE&name=mycore&configSet=myconfigset
>  Solr
> tells me:
>
> Caused by: org.apache.solr.common.SolrException: Error loading solr config
> from //configsets/myconfigset/conf/solrconfig.xml
> at
> org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:186)
> at
> org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:94)
> at
> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
> ... 30 more
> Caused by: org.apache.solr.common.SolrException: No system property or
> default value specified for  value:
> 
> at
> org.apache.solr.util.PropertiesUtil.substituteProperty(PropertiesUtil.java:66)
> ...
>
> Where should I put my properties so Solr can load them when I create a new
> core using this config set? From what I read I could specify them as system
> properties (-Dmyproperty=...) but I'd rather keep them in a file that I can
> check in.
>
> Thanks!
> Georg
>
>
>