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

Yevhen Tienkaiev edited comment on SOLR-11508 at 10/7/20, 12:50 AM:
--------------------------------------------------------------------

What the status of this? It's 2020 here, but I'm still in trap with docker 
config.


was (Author: hronom):
What the status of this? It's 2020 here, but I'm still in trap with docker 
config and that *core.properties* not stored inside data dir.

We have policy, to keep our solr docker image less customized as possible, 
because each customization you need to support.

It will be good, if you provide possibility through environment variable to 
adjust core directory.
So we can move it data dir and solr home will be updated with your updates in 
new versions of solr as far, as we switch to new docker image. 
This will allow to have core.properties in data directory and during upgrade of 
container solr home with new solr.xml config we will not be in situation when 
we lost cores.

So please can you add this line in *solr.xml* config:
{code}
<str name="coreRootDirectory">${solr.coreRootDirectory:}</str>
{code}

And make sure that in code here 
org.apache.solr.core.NodeConfig.NodeConfigBuilder#setCoreRootDirectory you 
check is *coreRootDirectory* string empty or not:
{code}
    public NodeConfigBuilder setCoreRootDirectory(String coreRootDirectory) {
     // Add if with empty string check here
      this.coreRootDirectory = solrHome.resolve(coreRootDirectory).normalize();
      return this;
    }
{code}

So later we can do next through env variable:
{code}
- SOLR_OPTS=-Dsolr.environment=dev -Dsolr.allowPaths=* 
-Dsolr.coreRootDirectory=/bla/bla
{code}

This will unblocks us, and provide backward compatibility.

Hope it will be easy for maintainers to add this, thanks!

> Make coreRootDirectory configurable via an environment variable 
> (SOLR_CORE_HOME)
> --------------------------------------------------------------------------------
>
>                 Key: SOLR-11508
>                 URL: https://issues.apache.org/jira/browse/SOLR-11508
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Marc Morissette
>            Priority: Major
>
> (Heavily edited)
> Since Solr 7, it is possible to store Solr cores in separate disk locations 
> using solr.data.home (see SOLR-6671). This is very useful when running Solr 
> in Docker where data must be stored in a directory which is independent from 
> the rest of the container.
> While this works well in standalone mode, it doesn't in Cloud mode as the 
> core.properties automatically created by Solr are still stored in 
> coreRootDirectory and cores created that way disappear when the Solr Docker 
> container is redeployed.
> The solution is to configure coreRootDirectory to an empty directory that can 
> be mounted outside the Docker container.
> The incoming patch makes this easier to do by allowing coreRootDirectory to 
> be configured via a solr.core.home system property and SOLR_CORE_HOME 
> environment variable.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to