linux系统磁盘挂载教程:linux服务器磁盘挂载,新手手把手教学,傻瓜式教程_风电猿的博客-CSDN博客
START
1. 安装包下载,提供1.8.0版本的Influxdb安装包
百度网盘 请输入提取码 qlyx
2. 安装指令
yum localinstall influxdb-1.8.0.x86_64.rpm -y
3.测试是否安装成功
influx ## 打开influxdb
show users ## 查看用户
create user 用户名 with password 密码 with all privileges ##创建新用户
show users ##
4. 设置为开机启动
[root@promethusgrafana ~]# systemctl start influxdb
[root@promethusgrafana ~]# systemctl enable influxdb
5. 修改influxdb数据储存路径
默认配置文件所在路径:{influxdb目录}/etc/influxdb/influxdb.conf
将influxdb的*/data、*/meta、*/wal三个文件夹
移动到新挂载的盘 /sda1/influx/data、/sda1/influx/meta、/sda1/influx/wal
5.1 文件夹准备
mkdir -p /sda1/influxdb/conf
cp /etc/influxdb/influxdb.conf /sda1/influxdb/conf/
cd /sda1/influxdb
mkdir meta
mkdir data
mkdir wal
5.2 修改配置文件influxdb.conf
vim /etc/influxdb/influxdb.conf ## 打开配置环境
修改[meta] 模块
[meta]
# Where the metadata/raft database is stored
dir = "/var/lib/influxdb/meta"
修改为
[meta]
# Where the metadata/raft database is stored
dir = "/sda1/influxdb/meta"
##########
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/var/lib/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/var/lib/influxdb/wal"
修改为
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/sda1/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/sda1/influxdb/wal"
修改完后,按ESC,输入‘:wq' 保存退出
要想更该后的配置文件起作用,必须给新的文件夹赋予权限。
执行一下命令,给/sda1赋予权限
chown -R influxdb:influxdb /sda1
启动influxdb,指令如下:
systemctl start influxdb ## 启动
systemctl restart influxdb ## 重启
systemctl stop influxdb ## 停止