背景:
- 为了收集flink metrics 用influxdb和grafana做监控
- 部署节奏 在root账号步骤下 赋权限给个人账号比启动
详细步骤
1.下载与安装
wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.0.x86_64.rpm
yum -y localinstall influxdb-1.8.0.x86_64.rpm
2.修改配置文件
whereis influxdb
vim /etc/influxdb/influxdb.conf
3.修改如下:
1.修改存储路径也可用默认的path
[meta]
# Where the metadata/raft database is stored
dir = "/mypath/influxdb/meta"
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/mypath/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/mypath/influxdb/wal"
2.改下端口 也可以用默认的8086
# The bind address used by the HTTP service.
bind-address = ":8086"
4.赋权限
在root账号下:
Chown -R mycount /mypath
Tips: mypath就是 上面要改的三个路径
不赋权限 就会报错 mkdir 文件没权限
5.在mycount下启动influxdb
sudo su - mycount //切换到自己账号
nohup influxd -config /etc/influxdb/influxdb.conf > /mypath/influxdb/log/influxd.log 2>&1 & //启动influxdb
6.通过 influx 命令进入 influxDB,创建数据库:
> CREATE DATABASE flink_metrics;
>
> SHOW DATABASES;
name: databases
name
----
_internal
flink_metrics