You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Noble Paul (JIRA)" <ji...@apache.org> on 2009/05/14 16:58:45 UTC

[jira] Issue Comment Edited: (SOLR-1154) allow specifying solr configuration file through system property to simplify deployment procedure in certain cases

    [ https://issues.apache.org/jira/browse/SOLR-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708316#action_12708316 ] 

Noble Paul edited comment on SOLR-1154 at 5/14/09 7:57 AM:
-----------------------------------------------------------

what I am going to say is hack (not at all elegant). but will work



{code}
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="${master:master}">
<str name="replicateAfter">commit</str>
<str name="confFiles">schema.xml,stopwords.txt</str>
</lst>
<lst name="${slave:slave}">
<str name="masterUrl">http://localhost:8983/solr/replication</str>
<str name="pollInterval">00:00:60</str>
</lst>
</requestHandler>
{code}

when you start the server in the master you can pass in -Dslave=disabled and in the slave pass in -Dmaster=disabled

this will change the tag value and it can become disabled automatically

BTW the root of the problem is that there is no way to include snippets of configuration from external files . I guess that needs to be addressed separately




      was (Author: noble.paul):
    what I am going to say is hack (not at all elegant). but will work



{code}
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="${master:master}">
<str name="isDisabled">${diable-master: false}</str>
<str name="replicateAfter">commit</str>
<str name="confFiles">schema.xml,stopwords.txt</str>
</lst>
<lst name="${slave:slave}">
<str name="masterUrl">http://localhost:8983/solr/replication</str>
<str name="pollInterval">00:00:60</str>
</lst>
</requestHandler>
{code}

when you start the server in the master you can pass in -Dslave=disabled and in the slave pass in -Dmaster=disabled

this will change the tag value and it can become disabled automatically

BTW the root of the problem is that there is no way to include snippets of configuration from external files . I guess that needs to be addressed separately



  
> allow specifying solr configuration file through system property to simplify deployment procedure in certain cases
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1154
>                 URL: https://issues.apache.org/jira/browse/SOLR-1154
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Jianhan
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-1154.patch, SOLR-1154.patch
>
>   Original Estimate: 5h
>  Remaining Estimate: 5h
>
> Hi,
> I wanted to use this parameter to specify different solr configuration files for master and slave to simplify deployment procedure. Unfortunately, I can't dynamically replace the value of this parameter. Basically, what I want is
>   <filter>
>     <filter-name>SolrRequestFilter</filter-name>
>     <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
>     <init-param>
>       <param-name>solrconfig-filename</param-name>
>       <param-value>solrconfig-master.xml</param-value>
>     </init-param>
> </filter>
> for master instance, and
>   <filter>
>     <filter-name>SolrRequestFilter</filter-name>
>     <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
>     <init-param>
>       <param-name>solrconfig-filename</param-name>
>       <param-value>solrconfig-slave.xml</param-value>
>     </init-param>
> </filter>
> for slave instance.
> Ideally, if I can use system property for its value like in solrconfig.xml. For example,
>   <filter>
>     <filter-name>SolrRequestFilter</filter-name>
>     <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
>     <init-param>
>       <param-name>solrconfig-filename</param-name>
>       <param-value>${solr.config.filename: solrconfig.xml}</param-value>
>     </init-param>
> </filter>
> but I learned that in general we can't use system property in web.xml.
> I realize that I can use replication of config file to achieve this, but I thought that creates unnecessary dependencies for slaves on master instance.
> So here is my proposal:
> make SolrDispatchFilter look up another init parameter, say 'solrconfig-filename-property', and its value is a system property name, and if this property is set, we get the file name, otherwise nothing happens (of course, if both exist, 'solrconfig-filename' takes precedence). This will give us maximum flexibility of specifying configuration files for different instances.
> Your thoughts?
> Thanks,
> Jianhan

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.