lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: dynamically adding core with auto-discovery in Solr 4.5
Date Wed, 09 Oct 2013 12:15:54 GMT

This worked for me if I do NOT have a at all in my new
core. Personally I think the behavior in 4.4 was dangerous, what
happens if you mis-type the command for instance? You could do  Bad
Things to the old core you were inadvertently re-creating.

The file gets created in the new core as a results of
the CREATE command. So go ahead and try it again without a file perhaps?

The RELOAD command is intended to be used when you change the schema
or solrconfig files and want the core indicated to start working with
the new definitions. It relies on having a record of that core to

When Solr starts up in discovery mode, it explores the directory tree
and keeps an internal map of all the cores, transient, loaded etc. The
reload then looks at that map and barfs if the core isn't there.

Changing this seems like more work than reward, how would the code
know where to look for the core to load? It would have to do a re-walk
of the tree, or rely on instanceDir being an absolute path etc.
Do-able but not worth it IMO.


On Tue, Oct 8, 2013 at 4:38 PM, Jan Van Besien <> wrote:
> Hi,
> We are using auto discovery and have a use case where we want to be
> able to add cores dynamically, without restarting solr.
> In 4.4 we were able to
> - add a directory (e.g. "core1") with an empty
> - call http://localhost:8983/solr/admin/cores?action=CREATE&core=core1&name=core1&instanceDir=%2Fsomewhere%2Fcore1
> In 4.5 however this (the second step) fails, saying it cannot create a
> new core in that directory because another core is already defined
> there.
> From the documentation (, I
> understand that since 4.3 we should actually do "RELOAD". However,
> RELOAD results in this stacktrace:
> org.apache.solr.common.SolrException: Error handling 'reload' action
> at org.apache.solr.handler.admin.CoreAdminHandler.handleReloadAction(
> at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(
> at org.apache.solr.handler.RequestHandlerBase.handleRequest(
> at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
> at org.mortbay.jetty.servlet.ServletHandler.handle(
> at
> at org.mortbay.jetty.servlet.SessionHandler.handle(
> at org.mortbay.jetty.handler.ContextHandler.handle(
> at org.mortbay.jetty.webapp.WebAppContext.handle(
> at org.mortbay.jetty.handler.HandlerWrapper.handle(
> at org.mortbay.jetty.Server.handle( at
> org.mortbay.jetty.HttpConnection.handleRequest(
> at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(
> at org.mortbay.jetty.HttpParser.parseNext( at
> org.mortbay.jetty.HttpParser.parseAvailable( at
> org.mortbay.jetty.HttpConnection.handle( at
> at org.mortbay.thread.QueuedThreadPool$
> Caused by: org.apache.solr.common.SolrException: Unable to reload
> core: core1 at org.apache.solr.core.CoreContainer.recordAndThrow(
> at org.apache.solr.core.CoreContainer.reload(
> at org.apache.solr.handler.admin.CoreAdminHandler.handleReloadAction(
> ... 20 more Caused by: org.apache.solr.common.SolrException: No such
> core: core1 at org.apache.solr.core.CoreContainer.reload(
> ... 21 more
> Note that before I RELOAD, the core1 directory was created.
> Also note that next to the core1 directory, there is a core0 directory
> which has exactly the same content and is auto-discovered perfectly
> fine at startup.
> So... what should it be? Or am I missing something here?
> thanks in advance,
> Jan

View raw message