我在 InfluxDB 中遇到了设置身份验证的问题。首先,以下教程告诉我更改配置文件:
[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"
Run Code Online (Sandbox Code Playgroud)
但是当我更改并重新加载服务器时。我无法创建用户。
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>".
Run Code Online (Sandbox Code Playgroud)
因此,当使用我创建的数据库时:
USE example
ERR: unable to parse Basic Auth credentials
Run Code Online (Sandbox Code Playgroud)
现在我不知道我究竟做了什么来设置我的身份验证以仅授予用户(在这种情况下为 paul)读取和写入我的数据库的权力example。
现在Authentication是enabled,你需要自己进行验证,然后才能做数据库什么。
该错误unable to parse Basic Auth credentials表明您没有传入任何凭据。
如果您尝试使用influx二进制文件创建用户,则必须设置-username和-password选项。
例如:
influx -username "my_username" -password "my_password" \
-execute "CREATE USER parul WITH PASSWORD 'timeseries4days'
Run Code Online (Sandbox Code Playgroud)