InfluxDB安装、操控


一、安装

1. InfluxDB安装

  1. docker安装命令:
  docker run -d --name influxdb -p 8086:8086 quay.io/influxdb/influxdb:v2.0.3 --reporting-disabled
  1. 浏览器访问:http://127.0.0.1:8086/

2. Telegraf安装

参考地址: https://docs.influxdata.com/telegraf/v1.17/introduction/installation/
配置文件路径:/etc/telegraf/telegraf.conf

// 1.编辑安装源
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

// 2.安装
sudo yum install telegraf

// 3.启动
sudo systemctl start telegraf

3. Telegraf配置

  1. 自动配置
    服务器监控,docker,redis为自动配置
    参考:https://docs.influxdata.com/influxdb/v2.0/write-data/no-code/use-telegraf/auto-config/
  2. 手动配置
    参考:https://docs.influxdata.com/influxdb/v2.0/write-data/no-code/use-telegraf/manual-config/

二、常用操作

1.删除数据库

参考文档:https://docs.influxdata.com/influxdb/v2.0/write-data/delete-data/

// 1.进入容器
docker exec -it 7df65a /bin/bash
    
// 2.删除命令
influx delete --org game-demo --bucket game-data \
  --token 4Bq6YL7uswsV9Djzy09X60w_Isab06Hal-QG8MYIe85i_vNBBBt5oSI0w== \
  --start '1970-01-01T00:00:00Z' \
  --stop '2021-11-14T00:00:00Z' \
  --predicate '_measurement="login"'
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值