【问题标题】:How set authenticate in InfluxDB?如何在 InfluxDB 中设置身份验证?
【发布时间】:2019-06-28 05:31:39
【问题描述】:

我在 InfluxDB 中设置身份验证时遇到问题。首先跟随教程告诉我更改配置文件:

https://docs.influxdata.com/influxdb/v1.7/administration/authentication_and_authorization/#set-up-authentication

[http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = true # ✨
  log-enabled = true
  write-tracing = false
  pprof-enabled = false
  https-enabled = false
  https-certificate = "/etc/ssl/influxdb.pem"

但是当我更改并重新加载服务器时。我无法创建用户。

 CREATE USER paul WITH PASSWORD 'timeseries4days' WITH ALL PRIVILEGES
 ERR: unable to parse Basic Auth credentials
 Warning: It is possible this error is due to not setting a database.
 Please set a database with the command "use <database>".

所以,当使用我创建的数据库时:

 USE example
 ERR: unable to parse Basic Auth credentials

现在我不知道我究竟做了什么来设置我的身份验证以仅授予用户(在本例中为保罗)读取和写入我的数据库 example 的权力。

【问题讨论】:

    标签: influxdb


    【解决方案1】:

    现在Authenticationenabled,您需要先进行身份验证,然后才能在数据库中执行任何操作。

    错误unable to parse Basic Auth credentials 表明您没有传递任何凭据。

    如果您尝试使用 influx 二进制文件创建用户,则必须设置 -username-password 选项。

    例如:

    influx -username "my_username" -password "my_password" \
            -execute "CREATE USER parul WITH PASSWORD 'timeseries4days'
    

    【讨论】:

    • 这似乎不再适用于 v2.0.4...如果有人知道的话,很想知道如何在新版本中进行身份验证:)
    猜你喜欢
    • 2015-07-20
    • 1970-01-01
    • 1970-01-01
    • 2020-02-01
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 2022-01-23
    • 2016-08-21
    相关资源
    最近更新 更多