【问题标题】:Kuzzle: Using X-pack to connect with ElasticsearchKuzzle:使用 X-pack 连接 Elasticsearch
【发布时间】:2021-02-26 13:16:30
【问题描述】:

我正在尝试使用在 Elasticsearch 上启用了 X-pack 身份验证的 Kuzzle。

我已尝试查看 Kuzzle 的文档,我假设 X-pack 密码应存储在 in the secrets vault 中,并且配置应设置在 .kuzzlerc 文件中。

我很想解释一下如何设置它。 ????

【问题讨论】:

    标签: elasticsearch elasticsearch-x-pack kuzzle


    【解决方案1】:

    要实现对 Elasticsearch 的 X-Pack 身份验证,您必须将凭据传递给 ES 客户端构造函数。

    .kuzzlerc 文件不能与 Vault 中的值一起使用,您可能不想在此处公开明确的凭据。

    修改客户端配置最好的方法是使用app.config.set方法注入你的自定义配置:

    app.config.set('services.storageEngine.client', {
      node: 'http://elasticsearch:9200',
      auth: {
        username: 'elastic',
        password: 'password',
      }
    });
    

    这个对象的内容会直接传给Javascript ES client constructor

    从 Kuzzle 2.10.2 开始,您可以在应用程序启动之前使用来自 Vault 的值,从而在配置中使用它。

    app.config.set('services.storageEngine.client', {
      node: 'http://elasticsearch:9200',
      auth: {
        username: 'elastic',
        password: app.vault.elasticsearch.password,
      }
    });
    

    【讨论】:

      猜你喜欢
      • 2017-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多