Skip to content

psalagnac/solr-landr

Repository files navigation

Solr Landr

Solr Landr is a command line interface on top of SolrJ to interact with any accessible SolrCould cluster.

Building from source

TODO

Usage

TODO: review

Once successfully built, the shell script run.sh can be executed in root folder to start the tool. By default, the tool will look for a Zookeeper ensemble on localhost. This can be configured with parameters -zkhost and -zkroot.

Example 1: start the command line with Zookeeper running on localhost with default port, and no chroot: ./run.sh

Example 2: start the command line with Zookeeper running on a remote server, with a configured chroot: ./run.sh -zkhost remote:2181 -zkroot /solr

Complete list of parameter can be obtained by running ./run.sh -help.

Pragmas

Pragmas are special statements that are internal to the Solr client. All pragmas are executed with special syntax @pragma [params…​]

Supported commands

Solr commands

For commands that refer to a specific collection, the collection parameter can also be implicitly specified using @context pragma.

Collection management

create-collection

Create a new collection in the SolrCloud cluster. Parameter name is required, but it can also be implicitly specified using @context pragma.

Syntax: create-collection -name name [-shards shards] [-replicas replicas] [-type type] [-config config]

delete-collection

Delete an existing collection from the SolrCloud cluster. Parameter name is required, but it can also be implicitly specified using @context pragma.

Syntax: delete-collection -name name

delete-all-collections

Delete all existing collections from the SolrCloud cluster. This command accepts no parameters.

list-collections

Print the list of all existing collections. This command accepts no parameters.

backup

Create a collection snapshot.

Syntax: backup -collection collection -name name [-repository repository] [-location location] [-async async]

restore

Restore a snapshot into a new collection.

Syntax: restore -collection collection -name name [-repository repository] [-location location] [-async async]

Shard management

split-shard

Split a shard into two new sub-shards. The original shard is not removed and remains with inactive status.

Syntax: split-shard -collection collection -shard shard

delete-shard

Delete an inactive shard. This command will fail on an active shard. It is mostly useful to delete the parent shard after a split.

Syntax: delete-shard -collection collection -shard shard

Replica management

add-replica

Add a new replica to a shard.

Syntax: add-replica -collection collection -shard shard [-type type]

delete-replica

Deletes a named replica from the specified collection and shard.

Syntax: delete-replica -collection collection -shard shard -replica replica

move-replica

Move a replica from one node to another node by executing ADDREPLICA on the destination and then DELETEREPLICA on the source.

Syntax: move-replica -collection collection -replica replica -node node

Zookeeper commands

Following is the list of supported commands to interact directly with the Zookeeper ensemble. This is done with a client directly connecting to Zookeeper, which is independent of the one used by Solr client. Solr command and Zookeeper commands use independent sessions. There is no guarantee that the changes done with Zookeeper commands will not break the SolrCloud cluster.

zk-ls path: List the child nodes of specified node

zk-get path Get the data from node at the specific path

zk-create path Create a new Zookeeper node.

zk-delete path Delete a node at specific path.

About

Command Line Interface for Apache Solr

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages