一.安装InfuxDB1.配置 InfluxDB 的 yum 源:​

cat <<EOF |  tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL /$releasever
baseurl = https://repos.influxdata.com/rhel//$releasever//$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF

2.yum 安装influxdb

[root@njmon ~]# yum install -y influxdb
[root@njmon ~]# systemctl start influxdb
[root@njmon ~]# systemctl enable influxdb

3.创建 njmon 库

[root@njmon ~]# influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> create database njmon
> show databases;
name: databases
name
----
_internal
njmon
> exit

4.启用用户认证
添加用户,设置权限。

[root@njmon ~]# influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show users;
user admin
---- -----
> create user "admin" with password 'wwwwww' with all privileges;
> show users;
user admin
---- -----
admin true

5.InfluxDB 默认是禁用认证策略的。
编辑配置文件,把 [http] 下的 auth-enabled 选项设置为 true​​​​

auth-enabled = true

6.重启服务,配置生效


[root@njmon ~]# systemctl restart influxdb.service

版权声明:本文为博主原创文章,未经博主允许不得转载。

LINUX