You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Alessandro Hoss <al...@gmail.com> on 2017/12/27 14:06:49 UTC

Using _default configset in standalone mode

Hello,

After reading this
<https://lucene.apache.org/solr/guide/7_0/major-changes-in-solr-7.html#new-default-configset>
docs,
I'm trying to achieve the following with version 7.2.0:

   -

   When creating a new collection, if you *do not specify a configSet*, the
   _default will be used.
   -

      *If you use standalone mode, the instanceDir will be created
      automatically, using the _defaultconfigSet as it’s basis.*

But if I try to create a *core* in standalone mode without specifying a
configset, it searches for config files and throw this:

Error CREATEing SolrCore 'mycore1': Unable to create core [mycore1]
Caused by: Can't find resource 'solrconfig.xml' in classpath or
'/opt/solr-7.2.0/server/solr/mycore1'


And if I specify the configSet parameter, it uses the configset folder
instead of copying the conf folder to the new instanceDir.

Is that possible to create an instanceDir in standalone mode that *copies*
configurations from the _default configset?
I need something like creating configset with baseConfigSet
<https://lucene.apache.org/solr/guide/6_6/configsets-api.html#ConfigSetsAPI-create>,
but in standalone mode.
What's the best approach for doing this?

Any help is appreciated.

Re: Using _default configset in standalone mode

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/2/2018 12:55 PM, Alessandro Hoss wrote:
> Actually I haven't tried the bin/solr script because I do everything
> remotely on Solr. Thanks for the tip, it worked the way I want
> (copying the conf to a new folder), but I need to do it through an API
> and choosing what configset to copy from. 

<snip>

> That's exactly what I need. I've tried the Collections API, but it
> doesn't
> work when running on standalone mode (Doesn't it make sense to work
> and emulates the behavior of SolrCloud in standalone mode?).

The Collections API and the entire "collection" abstraction are features
of SolrCloud.  If you're not running in cloud mode, those are not available.

If you want to do absolutely everything remotely without accessing the
filesystem on the Solr server at all, then you're going to have to run
SolrCloud. 

The thing that makes all this possible in cloud mode is ZooKeeper.  All
configurations and cluster state information are in the zookeeper
database when Solr is running in cloud mode.  Cores created via the API
in cloud mode do not have a conf directory, and any conf directories
that are manually created are ignored.

https://zookeeper.apache.org/

For a fully fault-tolerant setup, ZooKeeper requires three separate
physical machines.  A minimum of two Solr machines are required for
fault tolerance.    The smallest possible fault-tolerant SolrCloud setup
is three machines.  Two of them would run both Solr and ZooKeeper, the
third would run ZooKeeper only.  Depending on the nature of the clients
that access Solr, you might also need a load balancer.

If you want a single-server setup that's not redundant, you can run Solr
with an embedded ZooKeeper server.  This is not recommended for
production, but can be useful for dev or staging.

Thanks,
Shawn


Re: Using _default configset in standalone mode

Posted by Alessandro Hoss <al...@gmail.com>.
Thanks Shawn,


> How are you doing the core create?
>
You're right, I was using CoreAdmin API.

If you use "bin/solr create"

Actually I haven't tried the bin/solr script because I do everything
remotely on Solr.
Thanks for the tip, it worked the way I want (copying the conf to a new
folder), but I need to do it through an API and choosing what configset to
copy from.

That is exactly what the configset feature is designed to do.  It
> emulates the behavior of SolrCloud in  standalone mode, where the
> instanceDir does not have a conf directory.  A central config directory
> is used.
>
That's exactly what I need. I've tried the Collections API, but it doesn't
work when running on standalone mode (Doesn't it make sense to work and
emulates the behavior of SolrCloud in standalone mode?).

> I need something like creating configset with baseConfigSet
> <https://lucene.apache.org/solr/guide/6_6/configsets-api.html#ConfigSetsAPI-create>,
> but in standalone mode.
>
Is there any API for doing this?

Thanks in advance.


On Tue, Jan 2, 2018 at 4:48 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 12/27/2017 7:06 AM, Alessandro Hoss wrote:
> > After reading this
> > <
> https://lucene.apache.org/solr/guide/7_0/major-changes-in-solr-7.html#new-default-configset
> >
> > docs,
> > I'm trying to achieve the following with version 7.2.0:

>
> >    -
> >    When creating a new collection, if you *do not specify a configSet*,
> the
> >    _default will be used.
> >    -
> >
> >       *If you use standalone mode, the instanceDir will be created
> >       automatically, using the _defaultconfigSet as it’s basis.*
> >
> > But if I try to create a *core* in standalone mode without specifying a
> > configset, it searches for config files and throw this:
>
> How are you doing the core create?
>

> If you're using the CoreAdmin API (either through the admin UI or using
> HTTP calls directly), then you cannot do it.  CoreAdmin is *ancient* and
> is just a way to add an existing core directory to Solr.  It has never
> copied configs, and if I had to guess, likely never will, unless a lot
> of users demand it.
>
> If you use "bin/solr create" or "bin\solr create" (depending on OS),

then your expected behavior should be what you get in version 7 -- it
> should create a new core directory, copy the _default configset to a
> conf directory inside it, and then use an HTTP call to add the new core
> to Solr.
>
> > And if I specify the configSet parameter, it uses the configset folder
> > instead of copying the conf folder to the new instanceDir.
>
> That is exactly what the configset feature is designed to do.  It
> emulates the behavior of SolrCloud in  standalone mode, where the
> instanceDir does not have a conf directory.  A central config directory
> is used.


> Shawn
>
>

Re: Using _default configset in standalone mode

Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/27/2017 7:06 AM, Alessandro Hoss wrote:
> After reading this
> <https://lucene.apache.org/solr/guide/7_0/major-changes-in-solr-7.html#new-default-configset>
> docs,
> I'm trying to achieve the following with version 7.2.0:
>
>    -
>    When creating a new collection, if you *do not specify a configSet*, the
>    _default will be used.
>    -
>
>       *If you use standalone mode, the instanceDir will be created
>       automatically, using the _defaultconfigSet as it’s basis.*
>
> But if I try to create a *core* in standalone mode without specifying a
> configset, it searches for config files and throw this:

How are you doing the core create?

If you're using the CoreAdmin API (either through the admin UI or using
HTTP calls directly), then you cannot do it.  CoreAdmin is *ancient* and
is just a way to add an existing core directory to Solr.  It has never
copied configs, and if I had to guess, likely never will, unless a lot
of users demand it.

If you use "bin/solr create" or "bin\solr create" (depending on OS),
then your expected behavior should be what you get in version 7 -- it
should create a new core directory, copy the _default configset to a
conf directory inside it, and then use an HTTP call to add the new core
to Solr.

> And if I specify the configSet parameter, it uses the configset folder
> instead of copying the conf folder to the new instanceDir.

That is exactly what the configset feature is designed to do.  It
emulates the behavior of SolrCloud in  standalone mode, where the
instanceDir does not have a conf directory.  A central config directory
is used.

Shawn