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 Jason <hi...@gmail.com> on 2016/08/19 09:19:39 UTC

How to recovery node

I'm new to solrcloud (ver.6.1). So, I'm in tutorial.
I tried to force removing specific node because I was wondering how to
recover a node.
But I can't solve the problem.

Below is my scenario.

> bin/solr -e cloud 
# make 2 nodes with 8983, 8984 port
# collection structure is below
# example/cloud/node1 (with 8983)
#                             /cloudexample_shard1_replica2
#                             /cloudexample_shard2_replica2
# example/cloud/node2 (with 8984)
#                             /cloudexample_shard1_replica1
#                             /cloudexample_shard2_replica1

> java -Dc=gettingstarted -jar post.jar *.xml
# indexing and searching is ok.

> bin/solr stop -p 8984
# force to shutdown node2 and remove example/cloud/node2

> mkdir -p example/cloud/new_node2/solr
> cp example/cloud/node1/solr/solr.xml example/cloud/new_node2/solr
> bin/solr start -c -p 8984 -z localhost:9983 -x
> example/cloud/new_node2/solr

everything is good so far, but after this how should I recover node2 same as
before remove?





--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-recovery-node-tp4292354.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to recovery node

Posted by Erick Erickson <er...@gmail.com>.
You removed the node by deleting directories. Therefore
Zookeeper still has a record for shard2_replica2
and shard1_replica2. When you added a new replica, it
had to choose a new name and those were already
taken, thus the "replica3" parts.

And that's the same explanation for why you have two "down"
nodes. The ZK state (see adminUI>>cloud>>tree>>cloudexample>>state.json)
still has the information for replica2 for both shards. Solr can't
magically know you removed the nodes permanently, maybe you
just shut down the Solr instance and it'll come back sometime....

So use the DELETEREPLICA command to clean up the down
replicas and you should be fine.

Best,
Erick

On Fri, Aug 19, 2016 at 8:36 AM, Jason <hi...@gmail.com> wrote:
> Hi, Erick
> I just know that ADDREPLICA command is for it.
> At that time writting my question, I just tried command
> http://localhost:8984/solr/admin/collections?action=ADDREPLICA&collection=cloudexample&shard=shard1&node=localhost:8984_solr.
> But it returned an error.
> Now I know what the problem is.
> Node name parameter needs actual IP.
> So now node2 with 2 replicas is running well.
> But I have another questions.
> Newly created Node2 has two shards as replica.
> Its names are 'cloudexample_shard1_replica3' and
> 'cloudexample_shard2_replica3'.
> Why isn't it 'cloudexample_shard1_replica2' and
> 'cloudexample_shard2_replica2'?
> And cloud graph likes below.
>
> cloudexample -- shard1 -- 10.3.4.20:8983 (Leader,Aactive)
>                                        10.3.4.20:8984 (Down)
>                                        10.3.4.20:8984 (Active)
>                      -- shard2 -- 10.3.4.20:8983 (Leader,Aactive)
>                                        10.3.4.20:8984 (Down)
>                                        10.3.4.20:8984 (Active)
>
> As shown the graph, two replicas turned out down.
> What happen? How should I do?
>
>
>
>
> Erick Erickson wrote
>> Let Solr do it for you. In this case use the collections API
>> ADDREPLICA command. You tell it what collection and
>> shard you want replicated, it'll create the right structure in the
>> right place and synch the index.
>>
>> See:
>> https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api_addreplica
>>
>> If you require exact placement of the replica, specify the "node"
>> parameter.
>>
>> Best,
>> Erick
>>
>> On Fri, Aug 19, 2016 at 2:19 AM, Jason &lt;
>
>> hialooha@
>
>> &gt; wrote:
>>> I'm new to solrcloud (ver.6.1). So, I'm in tutorial.
>>> I tried to force removing specific node because I was wondering how to
>>> recover a node.
>>> But I can't solve the problem.
>>>
>>> Below is my scenario.
>>>
>>>> bin/solr -e cloud
>>> # make 2 nodes with 8983, 8984 port
>>> # collection structure is below
>>> # example/cloud/node1 (with 8983)
>>> #                             /cloudexample_shard1_replica2
>>> #                             /cloudexample_shard2_replica2
>>> # example/cloud/node2 (with 8984)
>>> #                             /cloudexample_shard1_replica1
>>> #                             /cloudexample_shard2_replica1
>>>
>>>> java -Dc=gettingstarted -jar post.jar *.xml
>>> # indexing and searching is ok.
>>>
>>>> bin/solr stop -p 8984
>>> # force to shutdown node2 and remove example/cloud/node2
>>>
>>>> mkdir -p example/cloud/new_node2/solr
>>>> cp example/cloud/node1/solr/solr.xml example/cloud/new_node2/solr
>>>> bin/solr start -c -p 8984 -z localhost:9983 -x
>>>> example/cloud/new_node2/solr
>>>
>>> everything is good so far, but after this how should I recover node2 same
>>> as
>>> before remove?
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://lucene.472066.n3.nabble.com/How-to-recovery-node-tp4292354.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-recovery-node-or-replica-in-solrcloud-tp4292354p4292417.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to recovery node

Posted by Jason <hi...@gmail.com>.
Hi, Erick
I just know that ADDREPLICA command is for it.
At that time writting my question, I just tried command
http://localhost:8984/solr/admin/collections?action=ADDREPLICA&collection=cloudexample&shard=shard1&node=localhost:8984_solr.
But it returned an error.
Now I know what the problem is.
Node name parameter needs actual IP.
So now node2 with 2 replicas is running well.
But I have another questions.
Newly created Node2 has two shards as replica.
Its names are 'cloudexample_shard1_replica3' and
'cloudexample_shard2_replica3'.
Why isn't it 'cloudexample_shard1_replica2' and
'cloudexample_shard2_replica2'?
And cloud graph likes below.

cloudexample -- shard1 -- 10.3.4.20:8983 (Leader,Aactive)
                                       10.3.4.20:8984 (Down)
                                       10.3.4.20:8984 (Active)
                     -- shard2 -- 10.3.4.20:8983 (Leader,Aactive)
                                       10.3.4.20:8984 (Down)
                                       10.3.4.20:8984 (Active)

As shown the graph, two replicas turned out down.
What happen? How should I do?




Erick Erickson wrote
> Let Solr do it for you. In this case use the collections API
> ADDREPLICA command. You tell it what collection and
> shard you want replicated, it'll create the right structure in the
> right place and synch the index.
> 
> See:
> https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api_addreplica
> 
> If you require exact placement of the replica, specify the "node"
> parameter.
> 
> Best,
> Erick
> 
> On Fri, Aug 19, 2016 at 2:19 AM, Jason &lt;

> hialooha@

> &gt; wrote:
>> I'm new to solrcloud (ver.6.1). So, I'm in tutorial.
>> I tried to force removing specific node because I was wondering how to
>> recover a node.
>> But I can't solve the problem.
>>
>> Below is my scenario.
>>
>>> bin/solr -e cloud
>> # make 2 nodes with 8983, 8984 port
>> # collection structure is below
>> # example/cloud/node1 (with 8983)
>> #                             /cloudexample_shard1_replica2
>> #                             /cloudexample_shard2_replica2
>> # example/cloud/node2 (with 8984)
>> #                             /cloudexample_shard1_replica1
>> #                             /cloudexample_shard2_replica1
>>
>>> java -Dc=gettingstarted -jar post.jar *.xml
>> # indexing and searching is ok.
>>
>>> bin/solr stop -p 8984
>> # force to shutdown node2 and remove example/cloud/node2
>>
>>> mkdir -p example/cloud/new_node2/solr
>>> cp example/cloud/node1/solr/solr.xml example/cloud/new_node2/solr
>>> bin/solr start -c -p 8984 -z localhost:9983 -x
>>> example/cloud/new_node2/solr
>>
>> everything is good so far, but after this how should I recover node2 same
>> as
>> before remove?
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/How-to-recovery-node-tp4292354.html
>> Sent from the Solr - User mailing list archive at Nabble.com.





--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-recovery-node-or-replica-in-solrcloud-tp4292354p4292417.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to recovery node

Posted by Erick Erickson <er...@gmail.com>.
Let Solr do it for you. In this case use the collections API
ADDREPLICA command. You tell it what collection and
shard you want replicated, it'll create the right structure in the
right place and synch the index.

See: https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api_addreplica

If you require exact placement of the replica, specify the "node"
parameter.

Best,
Erick

On Fri, Aug 19, 2016 at 2:19 AM, Jason <hi...@gmail.com> wrote:
> I'm new to solrcloud (ver.6.1). So, I'm in tutorial.
> I tried to force removing specific node because I was wondering how to
> recover a node.
> But I can't solve the problem.
>
> Below is my scenario.
>
>> bin/solr -e cloud
> # make 2 nodes with 8983, 8984 port
> # collection structure is below
> # example/cloud/node1 (with 8983)
> #                             /cloudexample_shard1_replica2
> #                             /cloudexample_shard2_replica2
> # example/cloud/node2 (with 8984)
> #                             /cloudexample_shard1_replica1
> #                             /cloudexample_shard2_replica1
>
>> java -Dc=gettingstarted -jar post.jar *.xml
> # indexing and searching is ok.
>
>> bin/solr stop -p 8984
> # force to shutdown node2 and remove example/cloud/node2
>
>> mkdir -p example/cloud/new_node2/solr
>> cp example/cloud/node1/solr/solr.xml example/cloud/new_node2/solr
>> bin/solr start -c -p 8984 -z localhost:9983 -x
>> example/cloud/new_node2/solr
>
> everything is good so far, but after this how should I recover node2 same as
> before remove?
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-recovery-node-tp4292354.html
> Sent from the Solr - User mailing list archive at Nabble.com.