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

Shawn Heisey commented on SOLR-5931:
------------------------------------

{quote}
Is there a good workaround in the meantime?
We need a quick way to switch master URL on individual the slaves in case of 
site issues. Updating solrconfig.xml directly for particular slave doesn't work 
well because the change will get overwritten on each replication (unless we 
change this in master's solrconfig as well)
{quote}

One option is using xinclude in your solrconfig.xml file.  In solrconfig.xml, 
you would have something like this:

{code}
<requestHandler name="/replication" class="solr.ReplicationHandler" 
xmlns:xi="http://www.w3.org/2001/XInclude";>
  <lst name="slave">
    <xi:include href="masterUrl.xml">
      <xi:fallback><str 
name="masterUrl">http://default_master:port/solr/corename</str></xi:fallback>
    </xi:include>
    <!-- other replication options -->
  </lst>
</requestHandler>
{code}

With this config, normally masterUrl does not need to exist.  When you need to 
switch the master URL, create masterUrl.xml in the same location as 
solrconfig.xml and reload/restart.  It needs contents like this:

{code}
    <str name="masterUrl">http://master_host:port/solr/corename</str>
{code}

You can also do this without the fallback, in which case you'd use a config 
like this and masterUrl.xml would always need to exist.

{code}
<requestHandler name="/replication" class="solr.ReplicationHandler" 
xmlns:xi="http://www.w3.org/2001/XInclude";>
  <lst name="slave">
    <xi:include href="masterUrl.xml" />
    <!-- other replication options -->
  </lst>
</requestHandler>
{code}

As long as you don't include masterUrl.txt in the list of config files to 
replicate, it won't get overwritten on the slave.

This is only to give you the general idea of xinclude.  You can rearrange this 
in any way that you require.


> solrcore.properties is not reloaded when core is reloaded
> ---------------------------------------------------------
>
>                 Key: SOLR-5931
>                 URL: https://issues.apache.org/jira/browse/SOLR-5931
>             Project: Solr
>          Issue Type: Bug
>          Components: multicore
>    Affects Versions: 4.7
>            Reporter: Gunnlaugur Thor Briem
>            Assignee: Shalin Shekhar Mangar
>            Priority: Minor
>
> When I change solrcore.properties for a core, and then reload the core, the 
> previous values of the properties in that file are still in effect. If I 
> *unload* the core and then add it back, in the “Core Admin” section of the 
> admin UI, then the changes in solrcore.properties do take effect.
> My specific test case is a DataImportHandler where {{db-data-config.xml}} 
> uses a property to decide which DB host to talk to:
> {code:xml}
> <dataSource driver="org.postgresql.Driver" name="meta" 
> url="jdbc:postgresql://${dbhost}/${solr.core.name}" .../>
> {code}
> When I change that {{dbhost}} property in {{solrcore.properties}} and reload 
> the core, the next dataimport operation still connects to the previous DB 
> host. Reloading the dataimport config does not help. I have to unload the 
> core (or fully restart the whole Solr) for the properties change to take 
> effect.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to