根据日志,OpenSearch启动失败
[2025-08-28T17:10:26,967][INFO ][o.o.b.BootstrapChecks ] [node-1-magento248] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_cluster_manager_nodes / cluster.initial_master_nodes] must be configured
ERROR: OpenSearch did not exit normally - check the logs at /var/www/html/opensearch-2.19.0/logs/my-application-magento248.log
原因是bootstrap checks失败。具体错误是:ERROR: [1] bootstrap checks failed[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_cluster_manager_nodes / cluster.initial_master_nodes] must be configured这意味着OpenSearch认为你正在生产环境中运行(因为绑定到了非回环地址),因此需要配置发现设置。但是,我们只是本地开发环境,可以通过设置discovery.type为single-node来避免这个检查。另外,你提到没有显示密码,这是因为在配置中安全插件被禁用了(从日志中看到:OpenSearch Security plugin installed but disabled. This can expose your configuration (including passwords) to the public.),所以不需要密码。但是,由于bootstrap checks失败,OpenSearch没有正常启动,所以无法访问9200端口。**解决方法:**1. 修改config/opensearch.yml,添加以下配置: discovery.type: single-node 这会将OpenSearch设置为单节点模式,并且会通过bootstrap checks。
discovery.type: single-node