简体   繁体   English

Solr Cloud Security无法用于内部身份验证

[英]Solr Cloud Security not working for internal authentication

I am trying to use Solr Security on Solr 5.0 Cloud. 我正在尝试在Solr 5.0 Cloud上使用Solr Security。 Following process I have used :- 1. Modifying web.xml :- 我使用了以下过程:-1.修改web.xml:-

<security-constraint>
<web-resource-collection>
   <web-resource-name>AdminAllowedQueries</web-resource-name>
   <url-pattern>/admin/*</url-pattern>
 </web-resource-collection>
 <auth-constraint>
   <role-name>admin</role-name>
 </auth-constraint>  </security-constraint>     
<login-config>
 <auth-method>BASIC</auth-method>
 <realm-name>Solr Realm</realm-name></login-config>

 <security-role>
 <description>Admin</description>
 <role-name>admin</role-name>   </security-role>
  1. Changes in jetty.xml :- jetty.xml中的更改:-

    <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.security.HashLoginService"> <Set name="name">Solr Realm</Set> <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set> <Set name="refreshInterval">0</Set> </New> </Arg> </Call>

  2. Creating realm.properties:- solradmin: solradmin,admin 创建realm.properties:- solradmin: solradmin,admin

  3. Set SOLR OPTS in solr.in.sh:- 在solr.in.sh中设置SOLR OPTS:-

    SOLR_OPTS="$SOLR_OPTS -DinternalAuthCredentialsBasicAuthUsername=solradmin" SOLR_OPTS="$SOLR_OPTS -DinternalAuthCredentialsBasicAuthPassword=solradmin" SOLR_OPTS =“ $ SOLR_OPTS -DinternalAuthCredentialsBasicAuthUsername = solradmin” SOLR_OPTS =“ $ SOLR_OPTS -DinternalAuthCredentialsBasicAuthPassword = solradmin”

I am getting Unauthorized error while creating collection using following command:- 使用以下命令创建集合时出现未授权错误:-

localhost:8080/solr/admin/collections?action=CREATE&name=test&collection.configName=testconf&numShards=1

Kindly help or suggest the best to get this done. 请帮助或建议最好的方法来完成此任务。

Thanx in advance. 提前感谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM