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.

<strong>Solr</strong>Cloud Instances<br />

In <strong>Solr</strong>Cloud mode, it's best to leave the data and update log directories as the defaults <strong>Solr</strong> comes with and<br />

simply specify the solr.hdfs.home. All dynamically created collections will create the appropriate directories<br />

automatically under the solr.hdfs.home root directory.<br />

Set solr.hdfs.home in the form hdfs://host:port/path<br />

You should specify a lock factory type of ' hdfs' or none.<br />

bin/solr start -c -Dsolr.directoryFactory=HdfsDirectoryFactory<br />

-Dsolr.lock.type=hdfs<br />

-Dsolr.hdfs.home=hdfs://host:port/path<br />

This command starts <strong>Solr</strong> in <strong>Solr</strong>Cloud mode, using the defined JVM properties.<br />

Modifying solr.in.sh (*nix) or solr.in.cmd (Windows)<br />

The examples above assume you will pass JVM arguments as part of the start command every time you use bi<br />

n/solr to start <strong>Solr</strong>. However, bin/solr looks for an include file named solr.in.sh ( solr.in.cmd on<br />

Windows) to set environment variables. By default, this file is found in the bin directory, and you can modify it to<br />

permanently add the HdfsDirectoryFactory settings and ensure they are used every time <strong>Solr</strong> is started.<br />

For example, to set JVM arguments to always use HDFS when running in <strong>Solr</strong>Cloud mode (as shown above),<br />

you would add a section such as this:<br />

# Set HDFS DirectoryFactory & Settings<br />

-Dsolr.directoryFactory=HdfsDirectoryFactory \<br />

-Dsolr.lock.type=hdfs \<br />

-Dsolr.hdfs.home=hdfs://host:port/path \<br />

The Block Cache<br />

For performance, the HdfsDirectoryFactory uses a Directory that will cache HDFS blocks. This caching<br />

mechanism is meant to replace the standard file system cache that <strong>Solr</strong> utilizes so much. By default, this cache<br />

is allocated off heap. This cache will often need to be quite large and you may need to raise the off heap memory<br />

limit for the specific JVM you are running <strong>Solr</strong> in. For the Oracle/OpenJDK JVMs, the follow is an example<br />

command line parameter that you can use to raise the limit when starting <strong>Solr</strong>:<br />

-XX:MaxDirectMemorySize=20g<br />

HdfsDirectoryFactory Parameters<br />

The HdfsDirectoryFactory has a number of settings that are defined as part of the directoryFactory co<br />

nfiguration.<br />

<strong>Solr</strong> HDFS Settings<br />

Parameter Example Value Default Description<br />

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

533

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

Saved successfully!

Ooh no, something went wrong!