初识 TICK

less than 1 minute read

TICK 是Influx Data基于InfluxDB这个时序数据库打造的监控技术栈。下面来初步认识下它。

TICK stack

  • Telegraf:是采集指标并写入DB的agent,同时也有对指标做处理和聚合的能力 (通过强大的插件系统实现)。
  • InfluxDB:时序数据库,目前在DB Rank的 Time Series DB 分类中排名第一。单机版是开源的,也有商用集群版本。
  • Chronograf:用来配置数据可视化面板,我理解就是类似于Grafana。
  • Kapacitor:指标和事件的处理和报警引擎。

安装和启动

在Mac上安装:

brew install telegraf

brew install influxdb

brew install chronograf

brew install kapacitor

版本号:

> telegraf version                                                                                                                                                                                                   
Telegraf 1.20.0

> influxd version                                                                                                                                                                                                             
InfluxDB 2.0.8 (git: e91d41810f) build_date: 2021-08-13T17:55:41Z

> chronograf -v
Chronograf 1.8.0 (git: )

> kapacitor version                                                                                                                                          
Kapacitor  1.6.1 (git:  0eaf1848f412d555f57ed9724325e934ec4838e7)

启动:

brew services start influxdb

brew services start telegraf

brew services start chronograf

试用

InfluxDB 默认端口是 8086,浏览器登入 localhost:8086

首次启动进去后还得设置用户名、密码、组织等信息。

在 Load Data 页面设置Telegraf为数据源:

因为Telegraf采集数据后是推(PUSH)给InfluxDB的,所以需要一个用于给InfluxDB鉴权的token。

启动 Telegraf:

telegraf --config http://localhost:8086/api/v2/telegrafs/083a6695352fb000

链接http://localhost:8086/api/v2/telegrafs/083a6695352fb000中的就是一个telegraf配置文件。

过一会,查看InfluxDB的Data Explorer可以看到有cpu/disk等系统指标了。

Chronograf 默认端口是 8888,登入 localhost:8888

将Chronograf连上InfluxDB: 这里我卡住了,报错401,很奇怪,用户名密码明明是对的。 询问了下社区,原来这里必须选择InfluxDB V2 Auth,填写 organization 和 token 才行。

参考

  • https://www.influxdata.com/blog/introduction-to-influxdatas-influxdb-and-tick-stack/

Comments