You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Lvyankui <lv...@h3c.com> on 2019/10/23 01:33:55 UTC

答复: Solr enabled kerberos and create collection failed

My kerberos is set as below in solr.in.sh

             SOLR_AUTH_TYPE="kerberos"
             SOLR_AUTHENTICATION_OPTS="-Djava.security.auth.login.config=/etc/solr/conf/solr_server_jaas.conf \
            -DauthenticationPlugin=org.apache.solr.security.KerberosPlugin \
            -Dsolr.kerberos.cookie.domain=node1.h3c.hde.com \
            -Dsolr.kerberos.cookie.portaware=true \
            -Dhost=node1.h3c.hde.com \
            -Dsolr.kerberos.name.rules=DEFAULT \
            -Dsolr.kerberos.principal=HTTP/node1.h3c.hde.com@TEST222222.COM \
            -Dsolr.kerberos.keytab=/etc/security/keytabs/spnego.service.keytab "
And the jaas file is:

    Client {
      com.sun.security.auth.module.Krb5LoginModule required
      useKeyTab=true
      keyTab="/etc/security/keytabs/solr.service.keytab"
      storeKey=true
      useTicketCache=false
      debug=false
     principal="solr/node1.h3c.hde.com@TEST222222.COM";
    };
~
And I have run "kinit" before invoking "bin/solr" ,I run solr with 'bin/solr start -c -p 8983' in Ambari. I occur that error when I create a collection with curl and that error doesn't happen every time.


-----邮件原件-----
发件人: Jason Gerlowski [mailto:gerlowskija@gmail.com] 
发送时间: 2019年10月22日 20:26
收件人: solr-user@lucene.apache.org
主题: Re: Solr enabled kerberos and create collection failed

Hi,

You posted this same question in a different thread and Jorn Franke replied to say that you likely need to run "kinit" before invoking "bin/solr".  That seems like a likely possible explanation to me.
But, since you've given us very little information on how you've setup Kerberos and what you've tried, it's impossible to say for sure.

How did you set up Kerberos?  What is the java command that Solr is running with?  Have you tried running "kinit" before bin/solr?  Does the problem _only_ occur when running "bin/solr", or does a similar error message occur when making requests through curl or other clients?

You might want to read this page for other ideas of what information would help us help you:
https://cwiki.apache.org/confluence/display/solr/UsingMailingLists

Best,

Jason

On Sun, Oct 20, 2019 at 9:23 PM Lvyankui <lv...@h3c.com> wrote:
>
> SolrCloud mode, Solr and Zookeeper enabled kerberos, create collection 
> failed with following command curl --negotiate -u : 'http:// noder27:8983/solr/admin/collections?action=CREATE&name=test01&numShards=1&replicationFactor=1&collection.configName=_default&wt=json'
> The error is:
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":31818},
>   "failure":{
>     "noder27.hde.h3c.com:8983_solr":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://noder27.hde.h3c.com:8983/solr: Expected mime type application/octet-stream but got text/html. <html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\n<title>Error 401 Authentication required</title>\n</head>\n<body><h2>HTTP ERROR 401</h2>\n<p>Problem accessing /solr/admin/cores. Reason:\n<pre>    Authentication required</pre></p>\n</body>\n</html>\n"
> }}
>
> But if I restart Solr several times,it will return to normal probability.
> ----------------------------------------------------------------------
> ---------------------------------------------------------------
> 本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
> 的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
> 或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
> 邮件!
> This e-mail and its attachments contain confidential information from 
> New H3C, which is intended only for the person or entity whose address 
> is listed above. Any use of the information contained herein in any 
> way (including, but not limited to, total or partial disclosure, 
> reproduction, or dissemination) by persons other than the intended
> recipient(s) is prohibited. If you receive this e-mail in error, 
> please notify the sender by phone or email immediately and delete it!