InfluxData【部署 03】时序数据库 InfluxDB 离线安装配置使用(下载+安装+端口绑定+管理员用户创建(1)


本次的下载地址是:`https://repos.influxdata.com/rhel/7/x86_64/stable`,安装文件为`influxdb-1.7.6.x86_64.rpm`。


### 2.安装并绑定端口



1.本地安装

yum localinstall -y influxdb-1.7.6.x86_64.rpm

2.修改配置

vim /etc/influxdb/influxdb.conf

以下三个文件夹可根据需要进行修改

[meta]
dir = “/var/lib/influxdb/meta”
[data]
dir = “/var/lib/influxdb/data”
wal-dir = “/var/lib/influxdb/wal”

http相关参数

[http]

开启 HTTP API

enabled = true

bind-address = “:8086”

默认绑定端口为 8086可进行修改

bind-address = “:18088”

auth-enabled = false

用户及密码验证默认关闭【注意】创建管理员用户后生产环境进行开启

auth-enabled = true


### 3.启动服务并创建管理员用户


首先启动 influxdb 服务端:



1.正常后台启动

[root@aliyun ~]# systemctl start influxd

前台启动可以查看运行状态 也可以用 -config 指定启动时的配置文件

[root@aliyun ~]# /usr/bin/influxd
8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P’ 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8"“8b. 888 .d88P 888 d88P
8888888 888 888 888 888 “Y88888 888 888 8888888P” 8888888P”


进入命令行工具界面进行用户添加,由于修改了默认绑定的端口,需要添加`-port`参数指定端口:



2.进入命令行工具

[root@aliyun ~]# influx -port ‘18088’
Connected to http://localhost:18088 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query

创建管理员用户

create user “admin” with password ‘admin’ with all privileges;

查看用户信息

show users;
user admin


admin true


### 4.开启用户密码认证



vim /etc/influxdb/influxdb.conf

3.http相关参数

[http]

用户及密码验证默认关闭【注意】创建管理员用户后生产环境进行开启

auth-enabled = true


重启服务后使用用户名及密码进行登录:



重启服务

systemctl restart influxd

如果不使用用户及密码登录操作时会报错

[root@aliyun ~]# influx -port ‘18088’
Connected to http://localhost:18088 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query

show users;
ERR: unable to parse authentication credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command “use ”.

验证用户及密码

auth
username: admin
password:
show users;
user admin


admin true

使用用户名及密码正确登录

[root@aliyun ~]# influx -port ‘18088’ -username ‘admin’ -password ‘admin’
Connected to http://localhost:18088 version 1.7.6
InfluxDB shell version: 1.7.6
Enter an InfluxQL query

show users;
user admin


admin true


### 5.开机自启配置



enable 不能用 提示层级太深

systemctl enable influxd
Failed to execute operation: Too many levels of symbolic links


修改`/etc/rc.loal`文件实现开启启动:



vim /etc/rc.loal

添加启动命令

systemctl start influxd



  • 6
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值