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.

Finally, create your myid files in each of the dataDir directories so that each server knows which instance it is.<br />

The id in the myid file on each machine must match the "server.X" definition. So, the ZooKeeper instance (or<br />

machine) named "server.1" in the above example, must have a myid file containing the value "1". The myid file<br />

can be any integer between 1 and 255, and must match the server IDs assigned in the zoo.cfg file.<br />

To start the servers, you can simply explicitly reference the configuration files:<br />

cd <br />

bin/zkServer.sh start zoo.cfg<br />

bin/zkServer.sh start zoo2.cfg<br />

bin/zkServer.sh start zoo3.cfg<br />

Once these servers are running, you can reference them from <strong>Solr</strong> just as you did before:<br />

bin/solr start -e cloud -z localhost:2181,localhost:2182,localhost:2183 -noprompt<br />

For more information on getting the most power from your ZooKeeper installation, check out the ZooKeeper<br />

Administrator's <strong>Guide</strong>.<br />

Securing the ZooKeeper connection<br />

You may also want to secure the communication between ZooKeeper and <strong>Solr</strong>.<br />

To setup ACL protection of znodes, see ZooKeeper Access Control.<br />

Using ZooKeeper to Manage Configuration Files<br />

With <strong>Solr</strong>Cloud your configuration files are kept in ZooKeeper. These files are uploaded in either of the following<br />

cases:<br />

When you start a <strong>Solr</strong>Cloud example using the bin/solr script.<br />

When you create a collection using the bin/solr script.<br />

Explicitly upload a configuration set to ZooKeeper.<br />

Startup Bootstrap<br />

When you try <strong>Solr</strong>Cloud for the first time using the bin/solr -e cloud, the related configset gets uploaded to<br />

zookeeper automatically and is linked with the newly created collection.<br />

The below command would start <strong>Solr</strong>Cloud with the default collection name (gettingstarted) and default configset<br />

(data_driven_schema_configs) uploaded and linked to it.<br />

$ bin/solr -e cloud -noprompt<br />

You can also explicitly upload a configuration directory when creating a collection using the bin/solr<br />

script with the -d option, such as:<br />

$ bin/solr create -c mycollection -d data_driven_schema_configs<br />

The create command will upload a copy of the data_driven_schema_configs configuration directory to<br />

ZooKeeper under /configs/mycollection. Refer to the <strong>Solr</strong> Start Script <strong>Reference</strong> page for more details<br />

about the create command for creating collections.<br />

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

559

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

Saved successfully!

Ooh no, something went wrong!