linux系统 InfluxDB安装及配置,修改数据路径,傻瓜教程

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         ## 停止

  • 4
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值