[英]Solr Cloud Security not working for internal authentication
我正在嘗試在Solr 5.0 Cloud上使用Solr Security。 我使用了以下過程:-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>
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>
創建realm.properties:- solradmin: solradmin,admin
在solr.in.sh中設置SOLR OPTS:-
SOLR_OPTS =“ $ SOLR_OPTS -DinternalAuthCredentialsBasicAuthUsername = solradmin” SOLR_OPTS =“ $ SOLR_OPTS -DinternalAuthCredentialsBasicAuthPassword = solradmin”
使用以下命令創建集合時出現未授權錯誤:-
localhost:8080/solr/admin/collections?action=CREATE&name=test&collection.configName=testconf&numShards=1
請幫助或建議最好的方法來完成此任務。
提前感謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.