Support Questions

Find answers, ask questions, and share your expertise

Solr with Kerberos authentication -create collection Error 401

avatar
Explorer

I have secured solr7.4 cloud via kerberos authentication,and zookeeper also open Kerberos.

After  authenticating user info through keytab file " kinit  -kt  /etc/security/keytabs/solr.service.keytab solr/myhost@realm", through curl command to create solr collection and I got the following error:
Curl command: curl –negotiate –u :  ‘http://myhost:8983/solr/admin/collections?action=CREATE&name=col&numShards=1&replicationFactor=1&collection.configName=_default&wt=json’

The error info :

{

  “responseHeader”:{

“status”:0,

“QTime”:31818},

  “failure”:{

    “myhost:8983_solr”:”org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://myhost:8983/solr:Excepted mime type application/octet-stream but got text/html.

<html>

<head>

<meta http-equiv=\”Content-Type\” content=\”text/html;charset=utf-8\”/>”

<title> Error 401 Authentication required </title>

  </head>

  <body>

<h2>HTTP ERROR 401</h2>

<p> Problem accessing /solr/admin/cores.Reason:

  <pre> Authentication required</pre>

</p>

  </body>

</html>

}

}

When I debug the solr source code, found this exception is returned by “coreContainer.getZKController().getOverseerCollectionQueue().offer(Utils.toJson(m), timeout)”,so I doubt maybe the solr don’t authenticate zookeeper info and I use a no-kerberos zookeeper to replace the Kerberos zookeeper, solr collection can be created successfully.

How to solve the problem with Kerberos ZK?

1 REPLY 1

avatar
Explorer

supplement: this is a occasional problem,sometimes create collection successfully,sometimes failed