kapacitor icon indicating copy to clipboard operation
kapacitor copied to clipboard

kapacitor自定义检测日志生成问题

Open Yu-MR1019 opened this issue 4 years ago • 8 comments

你好,根据这个文档kapacitor已经成功启动,但是却没生成对应的的日志文件,对比成功案例,会生成三个不同的日志文件,如下: (Translation: (Hello, according to this document, Kapacitor has been successfully started, but the corresponding log file has not been generated. Comparing successful cases, three different log files will be generated, as follows:) air_failure.log bed_failure.log hotend_failure.log ; 个人对比成功案例,怀疑是因为kapacitor缺少了python调用ttest.py脚本文件的进程导致无法生成日志文件 (Translation: Personal comparison of successful cases, it is suspected that Kapacitor lacks the process of python to call the ttest.py script file, which makes it impossible to generate log files) ps -ef | grep kapacitor root 21831 1 16 16:37 ? 00:00:00 /usr/bin/kapacitord -config /etc/kapacitor/kapacitor.conf root 21865 21831 99 16:37 ? 00:00:01 /usr/bin/python2 -u /tmp/kapacitor_udf/ttest.py root 21866 21831 99 16:37 ? 00:00:01 /usr/bin/python2 -u /tmp/kapacitor_udf/ttest.py root 21867 21831 93 16:37 ? 00:00:00 /usr/bin/python2 -u /tmp/kapacitor_udf/ttest.py Ps:这里使用root启动的kapacitor的服务 还请求助,谢谢 (Translation: Ps: Here is the service of Kapacitor started by root Also ask for help, thank you)

Yu-MR1019 avatar Jan 14 '21 08:01 Yu-MR1019

你好,请问你得Kapacitor是如何启动的?是linux版本还是docker版本,如果是linux版本的话,能否告知下怎么配置吗?我在使用的时候一直报这样的错误(Translation:Hello, how do you start Kapacitor? Is it the linux version or the docker version, if it is the linux version, can you tell me how to configure it? I keep reporting this error when I use it)

ts=2021-01-18T11:42:55.865+08:00 lvl=error msg="encountered error" service=run err="failed to open diagnostic service: open /var/log/kapacitor/kapacitor.log: permission denied"

ps:我使用的数据库是influxdb2.x,telegraf为1.17.0

感谢 (Translation: The database I use is influxdb 2.x, and telegraf is 1.17.0 thank you)

chuck199202104 avatar Jan 18 '21 06:01 chuck199202104

linux版本Centos.7x即可 配置请见附件kapacitor.conf ,出现这个错误貌似是权限问题 kapacitor版本为:kapacitor-1.5.7 Ps:启动方式为root启动 (translation: Linux version Centos.7x is fine Please refer to the attached kapacitor.conf for configuration. This error appears to be a permission problem Kapacitor version is: kapacitor-1.5.7 Ps: The startup method is root startup)

Yu-MR1019 avatar Jan 18 '21 06:01 Yu-MR1019

我用的是ubuntu系统,Kapacitor用的是1.7的,不知道和系统或者软件版本有关系吗.另外,我这边没看到你的配置附件,能否重新发一份呢,感谢 (Translation: I use the ubuntu system, and Kapacitor uses 1.7. I don’t know if it has anything to do with the system or software version. In addition, I didn’t see your configuration attachment here. Can you send a copy again? Thanks)

chuck199202104 avatar Jan 19 '21 02:01 chuck199202104

版本:Kapacitor OSS 1.5.7 Influxdb 企业版本1.8.2 Ubuntu和Linux一致,并没有什么太大关系,不通系统都测试过了,仍然是没有生成三个日志文件 Ps:这里需要注意一下,Influxdb版本最好使用1.20一下的,因为1.20是最新版本,默认是集成了kapacitor,建立你使用Influxdb1.8版本 (Translation: Version: Kapacitor OSS 1.5.7 Influxdb Enterprise Version 1.8.2 Ubuntu and Linux are the same, it doesn’t matter much. I have tested all the systems that fail, but still no three log files are generated Ps: I need to pay attention to it. Influxdb version is better than 1.20, because 1.20 is the latest version, and kapacitor is integrated by default. If you want to use Influxdb1.8 version)

Yu-MR1019 avatar Jan 19 '21 02:01 Yu-MR1019

之前有看过1.8版本的influxDB 但是发现和2.x的版本差异挺大,所以选择了使用后者.接着使用chronograf时,连接到influxdb上后,想去创建kapacitor的连接,但是ui上一直报错,大概意思时无法连接到kapacitor,让检查配置参数,但是参数都没啥问题.然后我就想着启动kapacitor服务,结果就是之前我们说的那个问题. 你大概的配置是什么样子的,一直没看到你说的附件!谢谢 (Translation: I have seen the 1.8 version of InfluxDB before but found that the version is quite different from 2.x, so I chose to use the latter. Then when I used chronograf, after connecting to influxdb, I wanted to create a connection to kapacitor, but the ui kept reporting errors , I can’t connect to kapacitor, let me check the configuration parameters, but there is nothing wrong with the parameters. Then I thought about starting the kapacitor service, and the result was the problem we mentioned before. What is your approximate configuration, I haven’t See the attachment you said! Thank you)

chuck199202104 avatar Jan 19 '21 02:01 chuck199202104

附件就在最下面,kapacitor.conf; 不可能没有,你可以把换成influxdb1.8试试看 (Translation: The attachment is at the bottom, kapacitor.conf; Impossible, you can change to influxdb1.8 and try)

Yu-MR1019 avatar Jan 19 '21 02:01 Yu-MR1019

@chuck199202104 -- you do not need to use Kapacitor with InfluxDB 2.0, unless you have been using Kapacitor previously with InfluxDB 1.x.

If you are starting fresh with a new installation of InfluxDB 2.0, use the Flux tasks capability.

timhallinflux avatar Feb 02 '21 21:02 timhallinflux

您好,我想问一下,在使用Kapcitor做自定义异常监测函数的时候,启动的时候一直出现:ts=2021-11-20T16:28:41.064+08:00 lvl=error msg="encountered error" service=run err="open server: open service *udf.Service: failed to load process info for "tTest": write error: write |1: broken pipe"的错误信息,请问有人知道这是什么原因造成的嘛?

AlpacaMe avatar Nov 20 '21 08:11 AlpacaMe