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.

When solr wants to create a new znode, it determines which ACLs to put on the znode by calling the getACLsT<br />

oAdd() method of the given acl provider. If no provider has been configured, the default implementation, Defau<br />

ltZkACLProvider is used.<br />

Out of the Box Implementations<br />

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

org.apache.solr.common.cloud.DefaultZkACLProvider: It returns a list of length one for all z<br />

NodePath-s. The single ACL entry in the list is "open-unsafe". This is the default and is used if you do not<br />

configure a provider in solr.xml.<br />

org.apache.solr.common.cloud.VMParamsAllAndReadonlyDigestZkACLProvider: This lets<br />

you define your ACLs using system properties. Its getACLsToAdd() implementation does not use zNod<br />

ePath for anything, so all znodes will get the same set of ACLs. It supports adding one or both of these<br />

options:<br />

A user that is allowed to do everything.<br />

The permission is " ALL" (corresponding to all of CREATE, READ, WRITE, DELETE, and ADMI<br />

N), and the schema is "digest".<br />

The username and password are defined by system properties " zkDigestUsername" and "<br />

zkDigestPassword", respectively.<br />

This ACL will not be added to the list of ACLs unless both username and password are<br />

provided.<br />

A user that is only allowed to perform read operations.<br />

The permission is " READ" and the schema is "digest".<br />

The username and password are defined by system properties "zkDigestReadonlyUsern<br />

ame" and " zkDigestReadonlyPassword, respectively.<br />

This ACL will not be added to the list of ACLs unless both username and password are<br />

provided.<br />

If neither of the above ACLs is added to the list, the (empty) ACL list of DefaultZkACLProvider will<br />

be used by default.<br />

Notice the overlap in system property names with credentials provider VMParamsSingleSetCredentialsDig<br />

estZkCredentialsProvider (described above). This is to let the two providers collaborate in a nice and<br />

perhaps common way: we always protect access to content by limiting to two users - an admin-user and a<br />

readonly-user - AND we always connect with credentials corresponding to this same admin-user, basically so<br />

that we can do anything to the content/znodes we create ourselves.<br />

You can give the readonly credentials to "clients" of your <strong>Solr</strong>Cloud cluster - e.g. to be used by <strong>Solr</strong>J clients.<br />

They will be able to read whatever is necessary to run a functioning <strong>Solr</strong>J client, but they will not be able to<br />

modify any content in ZooKeeper.<br />

Changing ACL Schemes<br />

Over the lifetime of operating your <strong>Solr</strong> cluster, you may decide to move from an unsecured ZooKeeper to a<br />

secured instance. Changing the configured zkACLProvider in solr.xml will ensure that newly created nodes<br />

are secure, but will not protect the already existing data. To modify all existing ACLs, you can use: ZkCLI -cmd<br />

updateacls /zk-path.<br />

Changing ACLs in ZK should only be done while your <strong>Solr</strong>Cloud cluster is stopped. Attempting to do so while<br />

<strong>Solr</strong> is running may result in inconsistent state and some nodes becoming inaccessible. To configure the new<br />

ACLs, run ZkCli with the following VM properties: -DzkACLProvider=...<br />

-DzkCredentialsProvider=....<br />

The Credential Provider must be one that has current admin privileges on the nodes. When omitted, the<br />

process will use no credentials (suitable for an unsecure configuration).<br />

The ACL Provider will be used to compute the new ACLs. When omitted, the process will set all<br />

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

563

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

Saved successfully!

Ooh no, something went wrong!