InfluxDB用户认证与授权

InfluxDB用户认证与授权

InfluxDB刚安装的时候,默认没有用户,默认没有认证,畅通无阻。

管理用户

显示用户

1
2
3
4
5
6
[root@ ~]# influx
Connected to http://localhost:8086 version 1.8.3
InfluxDB shell version: 1.8.3
> SHOW USERS
user admin
---- -----

创建管理员权限的用户,账户root,密码password

1
2
3
4
5
> CREATE USER root WITH PASSWORD 'password' WITH ALL PRIVILEGES
> show users
user admin
---- -----
root true

创建普通用户,账户weijian,密码password

1
CREATE USER weijian WITH PASSWORD 'password'

删除用户

1
DROP USER "username"

修改配置文件

就改一个地方,auth-enabled = false改成 true

1
vim /etc/influxdb/influxdb.conf
1
2
3
4
[http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = true

重启服务

1
sudo systemctl restart influxdb

账户密码登录

账户root,密码password

1
influx -username root -password password

InfluxDB Studio

在这里插入图片描述

在这里插入图片描述