本文介绍了批查询不允许从“衍生物"请求数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好,我用标准的tickstack设置创建了以下tickscript.其中包括:InfluxDB(最新版本)和kapacitor(最新版本):

Good afternoon,I have created the following tickscript with a standard tickstack setup.Which includes: InfluxDB(latest version) and kapacitor(latest version):

dbrp "derivatives"."default"
var data = batch
|query('select sum(value) from "derivatives"."default".derivative_test where time > now() - 10m')
        .every(1m)
        .period(2m)

var slope = data
    |derivative('value')
        .as('slope')
        .unit(2m)

slope
    |eval(lambda: ("slope" - "value") / "value")
        .as('percentage')

    |alert()
        .crit(lambda: "percentage" <= -50)
        .id('derivative_test_crit')
        .message('{{ .Level }}: DERIVATIVE FOUND!')
        .topic('derivative')

// DEBUGGING
    |influxDBOut()
        .database('derivatives')
        .measurement('derivative_logs')
        .tag('sum', 'sum')
        .tag('slope', 'slope')
        .tag('percentage', 'percentage')

但是每次我要定义它时,我都会收到以下消息:

But every time i want to define it i get the following message:

batch query is not allowed to request data from "derivatives"."autogen"

我以前从来没有遇到过 stream 的问题,但是我编写的每个 batch 滴答脚本都返回相同的消息.

I never had this problem before with stream's but every batch tick script i write returns the same message.

我的kapacitor用户具有完整的管理员权限,我可以通过curl请求获取数据,有人知道这可能是什么问题吗?

My kapacitor user has full admin privs and i am able to get the data via a curl request, does anyone have any idea what could possibly be the problem here?

我先谢谢你.

推荐答案

更改此内容

dbrp "derivatives"."default"
var data = batch
|query('select sum(value) from "derivatives"."default".derivative_test where time > now() - 10m')

对此:

dbrp "derivatives"."autogen"
var data = batch
|query('select sum(value) from "derivatives"."autogen".derivative_test where time > now() - 10m')

这可能并不明显,但是保留策略很可能是错误的.

It might not be obvious, but the retention policy is most likely incorrect.

如果您在衍生数据库上运行SHOW RETENTION POLICIES,您将看到RP.我怀疑您有一个autogen的RP,这是默认的RP.但是,除非创建RP,否则通常不会将默认"作为RP存在,它只是表明它是默认RP,如果可以的话?

If you run SHOW RETENTION POLICIES on the derivatives database you will see the RP's. I suspect you have an RP of autogen, which is the default RP. However "default" doesn't normally exist as an RP unless you create it, it just signifies that it is the default RP, if that makes sense?

RP文档可能有助于清除它数据库文档.

RP Documentation might help clear it up Database Documentation.

默认自动生成RP

这篇关于批查询不允许从“衍生物"请求数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 00:26