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 "A.Eibner" <a_...@yahoo.de> on 2013/05/15 12:53:56 UTC

Using the Collections API

Hi,

I just wanted to ask, if anyone is using the collections API to create 
collections,
or if not how they use the coreAPI to create a collection with 
replication ?

Because I run into errors when creating a collection on an empty solr.

Kind regards
Alexander

Re: Using the Collections API

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/15/2013 4:53 AM, A.Eibner wrote:
> I just wanted to ask, if anyone is using the collections API to create
> collections,
> or if not how they use the coreAPI to create a collection with
> replication ?

For my little SolrCloud install using 4.2.1, I have used the collections
API exclusively.  It has worked perfectly.

I updated SOLR-4734.

Thanks,
Shawn


Re: Using the Collections API

Posted by Mark Miller <ma...@gmail.com>.
What version of Solr? I think there was a bug a couple versions back (perhaps introduced in 4.1 if I remember right) that made it so creates were not spread correctly.

- Mark

Re: Using the Collections API

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/17/2013 4:03 AM, Jared Rodriguez wrote:
> So it sounds like you want the collection created with a master and a
> replica and you want one to be on each node?  If so, I believe that you can
> get that effect by specifying maxShardsPerNode=1 as part of your url line.
>  This will tell solr to create the master and replica that you desire but
> to not put them on the same node.

Jared,

The default value of maxShardsPerNode is 1.  Even if you make it higher,
the collections API won't put replicas for the same shard on the same
server, as long as the number of available hosts is a multiple of your
replication factor.

I would consider it a bug if the API were to ever put more than one
replica for the same shard on the same host, regardless of the number of
available hosts.  I do not know whether the API has such a bug or not.

A override option to allow replicas on the same host might make sense
for proof-of-concept setups, but you'd never want to use it in production.

Thanks,
Shawn


Re: Using the Collections API

Posted by "A.Eibner" <a_...@yahoo.de>.
Hi Jared,

yes that is what I want to achieve:
Creating a master and a replica and I want them to be separate nodes.

I just realized that I posted the wrong URL,  I was already using the 
parameter maxShardsPerNode=1.

But just to be sure, I also tried it with your URL and I get the same 
result.
Both replicas will be created on app02.
It does not matter where I create the collection (meaning app02 or 
app03) via the collections api.

And as I said, both nodes appear live in zookeeper

[zk: localhost:4181(CONNECTED) 1] ls /live_nodes
[app02:9985_solr, app03:9985_solr]

Any clue?

Regards
Alexander


Am 2013-05-17 12:03, schrieb Jared Rodriguez:
> Hi Alexander,
>
> So it sounds like you want the collection created with a master and a
> replica and you want one to be on each node?  If so, I believe that you can
> get that effect by specifying maxShardsPerNode=1 as part of your url line.
>   This will tell solr to create the master and replica that you desire but
> to not put them on the same node.
>
> Your url would look like:
>
> http://app02:9985/solr/admin/collections?action=CREATE&name=storage&numShards=1&replicationFactor=2&collection.configName=storage-conf&maxShardsPerNode=1
>
> The SolrCloud wiki does a good job of explaining the params and how they
> function.
> http://wiki.apache.org/solr/SolrCloud
>
>
> Jared
>
>
>
> On Fri, May 17, 2013 at 4:57 AM, A.Eibner <a_...@yahoo.de> wrote:
>
>> Hi, sorry for the delay.
>>
>> I have two live nodes (also zookeeper knows these two
>> [app02:9985_solrl,app03:9985_**solr])
>>
>> But when I want to create a collection via:
>>
>> http://app02:9985/solr/admin/**collections?action=CREATE&**
>> name=storage&numShards=1&**replicationFactor=2&**
>> collection.configName=storage-**conf<http://app02:9985/solr/admin/collections?action=CREATE&name=storage&numShards=1&replicationFactor=2&collection.configName=storage-conf>
>>
>> Both replicas will be created on app02.
>>
>> Any clues ?
>> Should I post anything else?
>>
>> Regards
>> Alexander
>>
>> Am 2013-05-15 14:48, schrieb Mark Miller:
>>
>>   Yeah, I use both on an empty Solr - what is the error?
>>>
>>> - Mark
>>>
>>> On May 15, 2013, at 6:53 AM, A.Eibner <a_...@yahoo.de> wrote:
>>>
>>>   Hi,
>>>>
>>>> I just wanted to ask, if anyone is using the collections API to create
>>>> collections,
>>>> or if not how they use the coreAPI to create a collection with
>>>> replication ?
>>>>
>>>> Because I run into errors when creating a collection on an empty solr.
>>>>
>>>> Kind regards
>>>> Alexander
>>>>
>>>
>>>
>>>
>>
>
>


Re: Using the Collections API

Posted by Jared Rodriguez <jr...@kitedesk.com>.
Hi Alexander,

So it sounds like you want the collection created with a master and a
replica and you want one to be on each node?  If so, I believe that you can
get that effect by specifying maxShardsPerNode=1 as part of your url line.
 This will tell solr to create the master and replica that you desire but
to not put them on the same node.

Your url would look like:

http://app02:9985/solr/admin/collections?action=CREATE&name=storage&numShards=1&replicationFactor=2&collection.configName=storage-conf&maxShardsPerNode=1

The SolrCloud wiki does a good job of explaining the params and how they
function.
http://wiki.apache.org/solr/SolrCloud


Jared



On Fri, May 17, 2013 at 4:57 AM, A.Eibner <a_...@yahoo.de> wrote:

> Hi, sorry for the delay.
>
> I have two live nodes (also zookeeper knows these two
> [app02:9985_solrl,app03:9985_**solr])
>
> But when I want to create a collection via:
>
> http://app02:9985/solr/admin/**collections?action=CREATE&**
> name=storage&numShards=1&**replicationFactor=2&**
> collection.configName=storage-**conf<http://app02:9985/solr/admin/collections?action=CREATE&name=storage&numShards=1&replicationFactor=2&collection.configName=storage-conf>
>
> Both replicas will be created on app02.
>
> Any clues ?
> Should I post anything else?
>
> Regards
> Alexander
>
> Am 2013-05-15 14:48, schrieb Mark Miller:
>
>  Yeah, I use both on an empty Solr - what is the error?
>>
>> - Mark
>>
>> On May 15, 2013, at 6:53 AM, A.Eibner <a_...@yahoo.de> wrote:
>>
>>  Hi,
>>>
>>> I just wanted to ask, if anyone is using the collections API to create
>>> collections,
>>> or if not how they use the coreAPI to create a collection with
>>> replication ?
>>>
>>> Because I run into errors when creating a collection on an empty solr.
>>>
>>> Kind regards
>>> Alexander
>>>
>>
>>
>>
>


-- 
Jared Rodriguez

Re: Using the Collections API

Posted by "A.Eibner" <a_...@yahoo.de>.
Hi, sorry for the delay.

I have two live nodes (also zookeeper knows these two 
[app02:9985_solrl,app03:9985_solr])

But when I want to create a collection via:

http://app02:9985/solr/admin/collections?action=CREATE&name=storage&numShards=1&replicationFactor=2&collection.configName=storage-conf

Both replicas will be created on app02.

Any clues ?
Should I post anything else?

Regards
Alexander

Am 2013-05-15 14:48, schrieb Mark Miller:
> Yeah, I use both on an empty Solr - what is the error?
>
> - Mark
>
> On May 15, 2013, at 6:53 AM, A.Eibner <a_...@yahoo.de> wrote:
>
>> Hi,
>>
>> I just wanted to ask, if anyone is using the collections API to create collections,
>> or if not how they use the coreAPI to create a collection with replication ?
>>
>> Because I run into errors when creating a collection on an empty solr.
>>
>> Kind regards
>> Alexander
>
>


Re: Using the Collections API

Posted by Mark Miller <ma...@gmail.com>.
Yeah, I use both on an empty Solr - what is the error?

- Mark

On May 15, 2013, at 6:53 AM, A.Eibner <a_...@yahoo.de> wrote:

> Hi,
> 
> I just wanted to ask, if anyone is using the collections API to create collections,
> or if not how they use the coreAPI to create a collection with replication ?
> 
> Because I run into errors when creating a collection on an empty solr.
> 
> Kind regards
> Alexander


Re: Using the Collections API

Posted by Jared Rodriguez <jr...@kitedesk.com>.
Hi Mark,

Yes, I am using reload.  Here is the jira that I filed.

https://issues.apache.org/jira/browse/SOLR-4805

Please let me know if there is any additional data that you need.


On Wed, May 15, 2013 at 12:53 PM, Mark Miller <ma...@gmail.com> wrote:

>
> On May 15, 2013, at 12:26 PM, Jared Rodriguez <jr...@kitedesk.com>
> wrote:
>
> > the cores in the collection stay offline even if there are no
> > material changes.
>
> I've used reload - if you are having trouble with it, please post more
> details or file a JIRA issue.
>
> - Mark




-- 
Jared Rodriguez

Re: Using the Collections API

Posted by Mark Miller <ma...@gmail.com>.
On May 15, 2013, at 12:26 PM, Jared Rodriguez <jr...@kitedesk.com> wrote:

> the cores in the collection stay offline even if there are no
> material changes.

I've used reload - if you are having trouble with it, please post more details or file a JIRA issue.

- Mark

Re: Using the Collections API

Posted by Jared Rodriguez <jr...@kitedesk.com>.
I have used both and they seem to work well for basic operations - create,
delete, etc.  Although newer operations like reload do not function as they
should - the cores in the collection stay offline even if there are no
material changes.


On Wed, May 15, 2013 at 6:53 AM, A.Eibner <a_...@yahoo.de> wrote:

> Hi,
>
> I just wanted to ask, if anyone is using the collections API to create
> collections,
> or if not how they use the coreAPI to create a collection with replication
> ?
>
> Because I run into errors when creating a collection on an empty solr.
>
> Kind regards
> Alexander
>



-- 
Jared Rodriguez