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.

-z -zkhost<br />

<br />

-c -collection<br />

<br />

-d -confdir<br />

<br />

ZooKeeper host address.<br />

This parameter is mandatory for all CLI commands.<br />

For<br />

linkconfig: name of the collection.<br />

For upconfig: a directory of configuration files. For downconfig: the destination of<br />

files pulled from Zookeeper<br />

-h -help Display help text.<br />

-n -confname<br />

<br />

-r -runzk<br />

<br />

-s -solrhome<br />

<br />

-name<br />

<br />

-val<br />

<br />

For upconfig, linkconfig, downconfig: name of the configuration set.<br />

Run ZooKeeper internally by passing the <strong>Solr</strong> run port; only for clusters on one<br />

machine.<br />

For bootstrap or when using -runzk: the mandatory solrhome location.<br />

For clusterprop: the mandatory cluster property name.<br />

For clusterprop: the cluster property value. If not specified, null will be used as<br />

value.<br />

The short form parameter options may be specified with a single dash (eg: -c mycollection).<br />

The long form parameter options may be specified using either a single dash (eg: -collection<br />

mycollection) or a double dash (eg: --collection mycollection)<br />

ZooKeeper CLI Examples<br />

Below are some examples of using the zkcli.sh CLI which assume you have already started the <strong>Solr</strong>Cloud<br />

example ( bin/solr -e cloud -noprompt)<br />

If you are on Windows machine, simply replace zkcli.sh with zkcli.bat in these examples.<br />

Upload a configuration directory<br />

./server/scripts/cloud-scripts/zkcli.sh -zkhost 127.0.0.1:9983 \<br />

-cmd upconfig -confname my_new_config -confdir<br />

server/solr/configsets/basic_configs/conf<br />

Bootstrap ZooKeeper from existing SOLR_HOME<br />

./server/scripts/cloud-scripts/zkcli.sh -zkhost 127.0.0.1:2181 \<br />

-cmd bootstrap -solrhome /var/solr/data<br />

Bootstrap with chroot<br />

Using the boostrap command with a zookeeper chroot in the -zkhost parameter, e.g. -zkhost<br />

127.0.0.1:2181/solr, will automatically create the chroot path before uploading the configs.<br />

Put arbitrary data into a new ZooKeeper file<br />

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

601

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

Saved successfully!

Ooh no, something went wrong!