我有一个需要身份验证的 Solr 核心。假设我有一个user带密码的password。当我现在尝试在控制台中创建 Solr 核心时
bin\solr create -c test
我收到 HTTP 错误 401。当然,我需要指定我的用户。如何在控制台中添加我的用户和密码?就像是bin\solr create -c test -authentication user:password
小智 6
将命令行脚本与 BasicAuth 结合使用将以下行添加到 (/opt/solr/bin) solr.in.sh 或 solr.in.cmd 文件中。此示例告诉 bin/solr 命令行使用“basic”作为身份验证类型,并使用用户名“solr”和密码“SolrRocks”传递凭据:请
SOLR_AUTH_TYPE="basic"
SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"
参阅:
https: //lucene.apache.org /solr/guide/6_6/basic-authentication-plugin.html#BasicAuthenticationPlugin-使用BasicAuthwithSolrJ
| 归档时间: |
|
| 查看次数: |
5189 次 |
| 最近记录: |