添加仓库地址
cat <<EOF | sudo 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
Yum安装influxdb
yum install influxdb -y
修改数据存放路径
# 目录创建 mkdir /home/influxdb/{meta,data,wal} # meta,存放数据库元数据; # data,存放最终存储的数据,文件以.tsm结尾; # wal,存放预写日志文件; # 赋权 chown -R influxdb:influxdb /home/influxdb # 运行influxdb systemctl start influxdb systemctl enable influxdb
开启认证
# 创建数据库用户和密码 influx -host 'localhost' -port '8086' Connected to http://localhost:8086 version 1.8.9 InfluxDB shell version: 1.8.9 > CREATE USER "test_user" WITH PASSWORD 'test_password' WITH ALL PRIVILEGES > exit # 启用认证 # [http] # ... auth-enabled = true # 重启influxdb服务 systemctl restart influxdb
参考文档:
Centos 7.4上InfluxDB 1.7.9的安装及简单使用(单机)-进城务工人员小梅 (meilongkui.com)