elasticsearch 安装magento2时出错在searchConfig.pg line81:无法验证到OpenSearch的连接,来自0的未知401错误pensearch null

wwtsj6pe  于 7个月前  发布在  ElasticSearch
关注(0)|答案(1)|浏览(97)

我安装Magento 2的第一次以下本教程https://www.javatpoint.com/how-to-install-magento-2-using-composer. XAMPP安装(与Apache和MySQL运行),数据库是在PHPMyAdmin上设置,但当我尝试运行php bin/magento安装:安装(步骤23在教程中)我得到错误在searchConfig.pg line 81:cannot validate a connection to the OpenSearch. Unknown 401 error from 0 pensearch null

{
  "name" : "HOME",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "5lWbyUHRQgyHeByx7CgSQw",
  "version" : {
    "number" : "8.10.3",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "c63272efed16b5a1c25f3ce500715b7fddf9a9fb",
    "build_date" : "2023-10-05T10:15:55.152563867Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

字符串
但是当运行此命令时,

php bin/magento setup:install --base-url="http://magento2.magento.com" --db-host="localhost" --db-name="magento2" --db-user="magento2" --db-password="magento2" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="Admin@123456" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch8 --elasticsearch-host="es1:9200" --elasticsearch-port=9200


我在searchConfig.pg line 81中得到错误:无法验证到OpenSearch的连接。来自0 pensearch null的未知401错误
如何修复此错误?
Thanks in Advance

8ljdwjyq

8ljdwjyq1#

HTTP 401通常表示OpenSearch/Elasticsearch登录时的username:password问题。(如果Elasticsearch识别出身份验证凭据但拒绝授权,则会出现下一步错误HTTP 403。)

我建议通过验证您的Elasticsearch/OpenSearch数据库开始调查
1.在https://localhost:9200上运行(其中端口9200是Elasticsearch的默认端口 *,或者 * 是针对通用端口HTTPS 443或HTTP 80或数据库配置中设置的其他自定义端口的数据库设置。
1.可以通过上面命令中的username:password配对进行身份验证,使用(1)中确认的端口,例如

curl -k -u "magento2:magento2" https://localhost:9200

例如,您可能打算使用不同的username:password配对进行身份验证,在这种情况下,您可以在确认新配对工作后更新代码片段的这一部分:--db-user="magento2" --db-password="magento2"
1.最后,一旦你确认username:password(2)应该起作用,你可能会返回到Magento设置命令是否要求你列出预期的端口。测试的成功取决于你的Magento的确切2.x版本,例如,StackExchange在v2.2上解析为github/magento2#4275

相关问题