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.

curl --user solr:<strong>Solr</strong>Rocks http://localhost:8983/solr/admin/authentication -H<br />

'Content-type:application/json' -d '{<br />

"set-property": {"blockUnknown":false}}'<br />

Using BasicAuth with <strong>Solr</strong>J<br />

In <strong>Solr</strong>J the basic auth credentials need to be set for each request as in this example:<br />

<strong>Solr</strong>Request req ;//create a new request object<br />

req.setBasicAuthCredentials(userName, password);<br />

solrClient.request(req);<br />

Securing inter-node requests<br />

There are a lot of requests that originate from the <strong>Solr</strong> nodes itself. e.g: requests from overseer to nodes,<br />

recovery threads etc . These requests do not carry any basic auth credentials because no user initiated these<br />

requests. This means the user is <strong>Solr</strong> itself. <strong>Solr</strong> uses a special internode authentication mechanism where each<br />

<strong>Solr</strong> node is a super user and is fully trusted by other <strong>Solr</strong> nodes.<br />

PKIAuthenticationPlugin<br />

This kicks in when there is any request going on between 2 <strong>Solr</strong> nodes. It is enabled only when the<br />

Authentication plugin does not wish to handle inter-node security (only BasicAuthPlugin as of now) .For each<br />

outgoing request PKIAuthenticationPlugin adds a special header '<strong>Solr</strong>Auth' which carries the<br />

timestamp and principal encrypted using the private key of that node. The public key is exposed through an API<br />

so that any node can read it whenever it needs it. Any node who gets the request with that header, would get the<br />

public key from the sender and decrypt the information. if it is able to decrypt the data, the request trusted. It is<br />

invalid if the timestamp is more than 5 secs old. This assumes that the clocks of different nodes in the cluster are<br />

synchronized. The timeout is configurable through a system property called 'pkiauth.ttl'. For example , if you wish<br />

to bump up the ttl to 10 seconds , start each node with a a property '-Dpkiauth.ttl=10' .<br />

Kerberos Authentication Plugin<br />

If you are using Kerberos to secure your network environment, the Kerberos authentication plugin can be used to<br />

secure a <strong>Solr</strong> cluster. This allows <strong>Solr</strong> to use a Kerberos service principal and keytab file to authenticate with<br />

ZooKeeper and between nodes of the <strong>Solr</strong> cluster. Users of the Admin UI and alll clients (such as <strong>Solr</strong>J) would<br />

also need to have a valid ticket before being able to use the UI or send requests to <strong>Solr</strong>.<br />

Support for the Kerberos authentication plugin is only available in <strong>Solr</strong>Cloud mode.<br />

If you are using <strong>Solr</strong> with a Hadoop cluster secured with Kerberos and intend to store your <strong>Solr</strong> indexes<br />

in HDFS, also see the section Running <strong>Solr</strong> on HDFS for additional steps to configure <strong>Solr</strong> for that<br />

purpose. The instructions on this page apply only to scenarios where <strong>Solr</strong> will be secured with Kerberos.<br />

If you only need to store your indexes in a Kerberized HDFS system, please see the other section<br />

referenced above.<br />

How <strong>Solr</strong> Works With Kerberos<br />

When setting up <strong>Solr</strong> to use Kerberos, configurations are put in place for <strong>Solr</strong> to use a service principal, or a<br />

Kerberos username, which is registered with the Key Distribution Center (KDC) to authenticate requests. The<br />

configurations define the service principal name and the location of the keytab file that contains the credentials.<br />

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

515

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

Saved successfully!

Ooh no, something went wrong!