11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

lr.xml 's section to the name of a class (on the classpath) implementing the following interface:<br />

package org.apache.solr.common.cloud;<br />

public interface ZkCredentialsProvider {<br />

public class ZkCredentials {<br />

String scheme;<br />

byte[] auth;<br />

}<br />

public ZkCredentials(String scheme, byte[] auth) {<br />

super();<br />

this.scheme = scheme;<br />

this.auth = auth;<br />

}<br />

String getScheme() {<br />

return scheme;<br />

}<br />

byte[] getAuth() {<br />

return auth;<br />

}<br />

}<br />

Collection getCredentials();<br />

<strong>Solr</strong> determines which credentials to use by calling the getCredentials() method of the given credentials<br />

provider. If no provider has been configured, the default implementation, DefaultZkCredentialsProvider is<br />

used.<br />

Out of the Box Implementations<br />

You can always make you own implementation, but <strong>Solr</strong> comes with two implementations:<br />

org.apache.solr.common.cloud.DefaultZkCredentialsProvider: Its getCredentials()<br />

returns a list of length zero, or "no credentials used". This is the default and is used if you do not configure<br />

a provider in solr.xml.<br />

org.apache.solr.common.cloud.VMParamsSingleSetCredentialsDigestZkCredentialsPr<br />

ovider: This lets you define your credentials using system properties. It supports at most one set of<br />

credentials.<br />

The schema is "digest". The username and password are defined by system properties "zkDiges<br />

Controlling ACLs<br />

tUsername" and " zkDigestPassword", respectively. This set of credentials will be added<br />

to the list of credentials returned by getCredentials() if both username and password are<br />

provided.<br />

If the one set of credentials above is not added to the list, this implementation will fall back to<br />

default behavior and use the (empty) credentials list from DefaultZkCredentialsProvider<br />

.<br />

You control which ACLs will be added by configuring zkACLProvider property in solr.xml 's <br />

section to the name of a class (on the classpath) implementing the following interface:<br />

package org.apache.solr.common.cloud;<br />

public interface ZkACLProvider {<br />

List getACLsToAdd(String zNodePath);<br />

}<br />

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

562

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

Saved successfully!

Ooh no, something went wrong!