如何在 InfluxDB 中设置身份验证?

How set authenticate in InfluxDB?

我在 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

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

错误 unable to parse Basic Auth credentials 提示您没有输入任何凭据。

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

例如:

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