一、安装
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
启动
# centos6.9安装
sudo yum install influxdb
# centos7 启动
sudo service influxdb start
# centos6.9安装
sudo yum install influxdb
# centos7 启动
sudo systemctl start influxdb
# 当前加载配置查看
influxd config
核心配置文件:
vim /etc/influxdb/influxdb.conf
# 数据源迁移(建议默认不要放在系统磁盘下面)
[meta]
# Where the metadata/raft database is stored
dir = "/workspace/service/influxdb/meta"
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/workspace/service/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/workspace/service/influxdb/wal"
# 赋权限
chown -R influxdb:influxdb /workspace/service/influxdb/
influxdb常用命令:
# 进入交互式界面
influx -precision rfc3339
# 创建db
CREATE DATABASE mydb
# 查看数据库
SHOW DATABASES
# 进入数据库
USE mydb
#显示该数据库中所有的表
show measurements
# 查看用户
show users
#创建所有权限用户
CREATE USER jmeter WITH PASSWORD 'jmeter' WITH ALL PRIVILEGES
# 删除用户
drop user jmeter