11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Force Shard Leader<br />

In the unlikely event of a shard losing its leader, this command can be invoked to force the election of a new<br />

leader<br />

/admin/collections?action=FORCELEADER&collection=&shard=<br />

Query Parameters<br />

Key Type Required Description<br />

collection string Yes The name of the collection<br />

shard string Yes The name of the shard<br />

This is an expert level command, and should be invoked only when regular leader election is not<br />

working. This may potentially lead to loss of data in the event that the new leader doesn't have certain<br />

updates, possibly recent ones, which were acknowledged by the old leader before going down.<br />

Migrate Cluster State<br />

A Expert level utility API to move a collection from shared clusterstate.json zookeeper node (created with<br />

stateFormat=1, the default in all <strong>Solr</strong> releases prior to 5.0) to the per-collection state.json stored in<br />

ZooKeeper (created with stateFormat=2, the current default) seamlessly without any application down-time.<br />

/admin/collections?action=MIGRATESTATEFORMAT&collection=<br />

Key Type Required Description<br />

collection string Yes The name of the collection to be migrated from clusterstate.json to its<br />

own state.json zookeeper node<br />

async string No Request ID to track this action which will be processed asynchronously.<br />

This API is useful in migrating any collections created prior to <strong>Solr</strong> 5.0 the more scalable cluster state format now<br />

used by default. If a collection was created in any <strong>Solr</strong> 5.x version or higher, then executing this command is not<br />

necessary.<br />

Asynchronous Calls<br />

Since some collection API calls can be long running tasks e.g. Shard Split, you can optionally have the calls run<br />

asynchronously. Specifying async= enables you to make an asynchronous call, the status of<br />

which can be requested using the REQUESTSTATUS call at any time.<br />

As of now, REQUESTSTATUS does not automatically clean up the tracking data structures, meaning the status<br />

of completed or failed tasks stays stored in ZooKeeper unless cleared manually. Sending a REQUESTSTATUS<br />

call with a requestid of -1 clears the stored statuses. However, there is a limit of 10,000 on the number of async<br />

call responses stored in a cluster.<br />

Example<br />

Input<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

598

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!