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 xinwu <xi...@gmail.com> on 2013/10/09 09:06:07 UTC

Multiple schemas in the same SolrCloud ?

Hi all,

I want to use the multiple schemas in the same solrCloud, is it allowed?

If it is allowed,how?


These schemas may have no relation.

Thank You.

Dai.



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Anshum Gupta <an...@anshumgupta.net>.
You can simply have multiple collections, each independent of each other on
the schema but could run on the same instance/jvm if you want.


On Wed, Oct 9, 2013 at 12:36 PM, xinwu <xi...@gmail.com> wrote:

> Hi all,
>
> I want to use the multiple schemas in the same solrCloud, is it allowed?
>
> If it is allowed,how?
>
>
> These schemas may have no relation.
>
> Thank You.
>
> Dai.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 

Anshum Gupta
http://www.anshumgupta.net

Re: Multiple schemas in the same SolrCloud ?

Posted by xinwu <xi...@gmail.com>.
Thank you,kamaci.



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094594.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Furkan KAMACI <fu...@gmail.com>.
You can have more information from here:
https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files


2013/10/9 xinwu <xi...@gmail.com>

> I remember I must put the
> "-Dbootstrap_confdir=/opt/Solr_home/collection1/conf
> -Dcollection.configName=solrConfig " in the catalina.sh .
>
> Is it means that solrCloud must have one ,and only one, schema?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094281.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Multiple schemas in the same SolrCloud ?

Posted by xinwu <xi...@gmail.com>.
Thank you,Shawn.

Thank you,everyone.

All your answers help me a lot.Thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094850.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by maephisto <my...@yahoo.com>.
Upload the new configuration and the use the collection API to reload you
collection
https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-ReloadaCollection



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094978.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by xinwu <xi...@gmail.com>.
Hi,kamaci.
Is that means I just need to upload new config files ,and do not need to
reload every node in solrCloud ,when I want to change my configurations?



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094908.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Furkan KAMACI <fu...@gmail.com>.
Here is a topic you should read it:
http://lucene.472066.n3.nabble.com/Reloading-config-to-zookeeper-td4021901.html


2013/10/11 maephisto <my...@yahoo.com>

> Thanks!
> My only doubt is: upload a new set of configuration files to the same
> configuration name like so:
>
> Initial configuration:
> zkcli.sh -zkhost localhost:9983 -cmd upconfig -confdir conf_initial/
> -confname my_custom_config
> and afterwards, to change it do:
> zkcli.sh -zkhost localhost:9983 -cmd upconfig -confdir conf_changed/
> -confname my_custom_config
>
> Is this correct?
> If so, what happens afterwards, will ZK distribute this changes to all
> cores
> and reload them?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094895.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Multiple schemas in the same SolrCloud ?

Posted by maephisto <my...@yahoo.com>.
Thanks!
My only doubt is: upload a new set of configuration files to the same
configuration name like so:

Initial configuration:
zkcli.sh -zkhost localhost:9983 -cmd upconfig -confdir conf_initial/
-confname my_custom_config
and afterwards, to change it do:
zkcli.sh -zkhost localhost:9983 -cmd upconfig -confdir conf_changed/
-confname my_custom_config

Is this correct?
If so, what happens afterwards, will ZK distribute this changes to all cores
and reload them?



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094895.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Upayavira <uv...@odoko.co.uk>.
Use $solrzip/example/cloud-scripts/zkcli.sh to upload a new set of
configuration files.

Upayavira

On Thu, Oct 10, 2013, at 04:57 PM, maephisto wrote:
> On this topic, once you've uploaded you collection's configuration in ZK,
> how
> can you update it?
> Upload the new one with the same config name ?
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094729.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Liu Bo <di...@gmail.com>.
you can try this way:

start zookeeper server first.

upload your configurations to zookeeper and link them to your collection
using zkcli just like shawn said

let's say you have conf1 and conf2, you can link them to collection1 and
collection2

remove the bootstrap stuff and start solr server.

after you have solr running, create collection1 and collection2 via core
admin, you don't have conf because all your core specified configurations
are in zookeeper

or you could use core discovery and have collection name specified in
core.properties, see :
http://wiki.apache.org/solr/Core%20Discovery%20%284.4%20and%20beyond%29



On 10 October 2013 23:57, maephisto <my...@yahoo.com> wrote:

> On this topic, once you've uploaded you collection's configuration in ZK,
> how
> can you update it?
> Upload the new one with the same config name ?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094729.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
All the best

Liu Bo

Re: Multiple schemas in the same SolrCloud ?

Posted by maephisto <my...@yahoo.com>.
On this topic, once you've uploaded you collection's configuration in ZK, how
can you update it?
Upload the new one with the same config name ?



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094729.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Shawn Heisey <so...@elyograg.org>.
On 10/10/2013 2:45 AM, xinwu wrote:
> I solved that problem by using the "-Dbootstrap_conf=true" configuration
> instead of the "-Dbootstrap_confdir=/opt/Solr_home/collection1/conf
> -Dcollection.configName=solrConfig" on startup.

You do not need this bootstrap option either.  Once your configurations
are loaded into zookeeper, nothing further is needed - the information
is there.

> But,another problem showed up.
> 
> I had two collections (collection1,collection2) when I started my Solr.
> Collection1 and Collection2 had different schema.
> 
> Then I created two other collections in my project which had the same schema
> with the collection2.
> But these two new collections only had "data" directory, which means there
> was no 'conf' directory.
> 
> And when I started my solr again,some errors showed up because of the
> missing of 'conf' directory.

This is expected, because the bootstrap options (especially
bootstrap_conf) are not intended for extended use.

SolrCloud doesn't use conf directories.  All that is in zookeeper.  The
bootstrap options are one way of converting configurations from
non-SolrCloud to SolrCloud.  Once that's done, it does not need to be
done again.

The other way of converting and maintaining SolrCloud configuration
information, which in my opinion is better, is with the zkcli utility
included in example/cloud-scripts.

This is the definition that most closely describes what bootstrapping
means with respect to SolrCloud.  Solr is not a development environment,
but the general notion applies:

http://en.wikipedia.org/wiki/Bootstrapping#Software_development

Thanks,
Shawn


Re: Multiple schemas in the same SolrCloud ?

Posted by xinwu <xi...@gmail.com>.
Thank you ,Shawn.

I solved that problem by using the "-Dbootstrap_conf=true" configuration
instead of the "-Dbootstrap_confdir=/opt/Solr_home/collection1/conf
-Dcollection.configName=solrConfig" on startup.

But,another problem showed up.

I had two collections (collection1,collection2) when I started my Solr.
Collection1 and Collection2 had different schema.

Then I created two other collections in my project which had the same schema
with the collection2.
But these two new collections only had "data" directory, which means there
was no 'conf' directory.

And when I started my solr again,some errors showed up because of the
missing of 'conf' directory.

How should I do?

Thanks.





--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094607.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Multiple schemas in the same SolrCloud ?

Posted by Shawn Heisey <so...@elyograg.org>.
On 10/9/2013 1:17 AM, xinwu wrote:
> I remember I must put the
> "-Dbootstrap_confdir=/opt/Solr_home/collection1/conf
> -Dcollection.configName=solrConfig " in the catalina.sh .
>
> Is it means that solrCloud must have one ,and only one, schema?

Those bootstrap options are intended to be used ONCE, and on only one of 
your Solr instances, not all of them.  What that does is take the 
configuration in the confdir and upload it to zookeeper, giving it the 
name you chose.

You can have many configurations with different names in zookeeper. Each 
collection is associated with a config name.  A better way than the 
bootstrap options is the zkcli script in cloud-scripts on the example.  
The "upconfig" command can be used to upload or change your configurations.

http://wiki.apache.org/solr/SolrCloud#Command_Line_Util

Thanks,
Shawn


Re: Multiple schemas in the same SolrCloud ?

Posted by xinwu <xi...@gmail.com>.
I remember I must put the
"-Dbootstrap_confdir=/opt/Solr_home/collection1/conf
-Dcollection.configName=solrConfig " in the catalina.sh .

Is it means that solrCloud must have one ,and only one, schema?



--
View this message in context: http://lucene.472066.n3.nabble.com/Multiple-schemas-in-the-same-SolrCloud-tp4094279p4094281.html
Sent from the Solr - User mailing list archive at Nabble.com.