kapacitor问题记录

kapacitor 有两种处理模式:stream和batch
stream 流处理
batch 批量处理

在本地部署kapacitor时,按照官方文档一一部署,操作到:
kapacitor record stream -task cpu_alert -duration 60s
等待了一两分钟 没有返回rid值数据;
验证系统配置信息:telegraf influxdb 和最新装kapacitor
发现单个部署都没问题:
查询influxdb
{“results”:[{“statement_id”:0,“series”:
[{“name”:"_internal",“columns”:
[“retention_policy”,“name”,“mode”,“destinations”],
“values”:[[“monitor”,“kapacitor-b4abdd3c-2036-405d-a36f-66758d6846c9”,“ANY”,[“http://localhost:9092”]]]
},
{“name”:“telegraf”,“columns”:
[“retention_policy”,“name”,“mode”,“destinations”],
“values”:[[“autogen”,“kapacitor-b4abdd3c-2036-405d-a36f-66758d6846c9”,“ANY”,[“http://localhost:9092”]]]
},
{“name”:“lora”,“columns”:
[“retention_policy”,“name”,“mode”,“destinations”],
“values”:[[“autogen”,“kapacitor-b4abdd3c-2036-405d-a36f-66758d6846c9”,“ANY”,[“http://localhost:9092”]]]
}
]
}
]
}

一切正常。
然后重启各个服务器试试:
(kill -9 关不掉telegraf )
systemctl stop telegraf
systemctl stop influxdb
systemctl stop kapacitor
启动
systemctl start influxdb
systemctl start telegraf
systemctl start kapacitor

/usr/bin/kapacitord -config /etc/kapacitor/kapacitor.conf &
重新验证刚刚信息:
kapacitor define cpu_alert -tick cpu_alert.tick
kapacitor record stream -task cpu_alert -duration 60s

ps:cpu_alert.tick 官网上样例内容是:
dbrp “telegraf”.“autogen”

stream
// Select just the cpu measurement from our example database.
|from()
.measurement(‘cpu’)
|alert()
.crit(lambda: int(“usage_idle”) < 70)
// Whenever we get an alert write it to a file.
.log(’/tmp/alerts.log’)

 但influxdb中usage_idle < 70 没有,为了测试这地方修改成: .crit(lambda: int("usage_idle") <  100)

kapacitor 报错信息汇总
1.invalid TICKscript: line 8 char 10: no property method “where” on *pipeline.AlertNode, but chaining method does exist. Use ‘|’ operator instead: ‘node|where(…)’.

无效的tick脚本

你可能感兴趣的:(安装部署)