如何在Docker中运行OpenSearch Dashboards时禁用登录页面?
禁用OpenSearch Dashboards本地开发环境的登录页面
你已经在OpenSearch容器中禁用了安全插件,但Dashboards默认仍会启用登录验证,因此需要在Dashboards的配置中同步关闭安全功能。只需给opensearch-dashboards服务添加两个环境变量即可解决问题:
修改后的完整docker-compose.yml配置如下:
opensearch: image: opensearchproject/opensearch container_name: opensearch-local ports: - "9200:9200" environment: discovery.type: single-node plugins.security.disabled: true opensearch-dashboards: image: opensearchproject/opensearch-dashboards container_name: opensearch-dashboards ports: - 5601:5601 expose: - "5601" environment: OPENSEARCH_HOSTS: '["http://opensearch-local:9200"]' # 新增配置:关闭Dashboards安全验证 OPENSEARCH_SECURITY_ENABLED: "false" DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true" depends_on: - opensearch
操作步骤:
- 将上述配置替换你本地的
docker-compose.yml文件 - 执行命令重启容器:
docker-compose down && docker-compose up -d - 再次访问
http://localhost:5601,即可直接进入Dashboards页面,无需登录
内容的提问来源于stack exchange,提问作者rouan
相关产品推荐
相关产品推荐

