Skip to content

Commit ac691eb

Browse files
authored
Merge branch 'master' into influxdb3-trigger-api
2 parents 687b834 + d177f37 commit ac691eb

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

content/influxdb3/clustered/admin/upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Use the following command to return the image Kubernetes uses to build your
5151
InfluxDB cluster:
5252

5353
```sh
54-
kubectl get appinstances.kubecfg.dev influxdb -o jsonpath='{.spec.package.image}'
54+
kubectl get appinstances.kubecfg.dev influxdb -n influxdb -o jsonpath='{.spec.package.image}'
5555
```
5656

5757
The package version number is at the end of the returned string (after `influxdb:`):

content/kapacitor/v1/guides/anomaly_detection.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,15 @@ if __name__ == '__main__':
407407
agent.handler = h
408408

409409
# Anything printed to STDERR from a UDF process gets captured into the Kapacitor logs.
410-
print >> sys.stderr, "Starting agent for TTestHandler"
410+
print("Starting agent for TTestHandler", file=sys.stderr)
411411
agent.start()
412412
agent.wait()
413-
print >> sys.stderr, "Agent finished"
413+
print("Agent finished", file=sys.stderr)
414414

415415
```
416416

417417
That was a lot, but now we are ready to configure Kapacitor to run our
418-
code. Create a scratch dir for working through the rest of this
418+
code. Make sure that `scipy` is installed (`$ pip3 install scipy`). Create a scratch dir for working through the rest of this
419419
guide:
420420

421421
```bash
@@ -434,7 +434,7 @@ Add this snippet to your Kapacitor configuration file (typically located at `/et
434434
[udf.functions]
435435
[udf.functions.tTest]
436436
# Run python
437-
prog = "/usr/bin/python2"
437+
prog = "/usr/bin/python3"
438438
# Pass args to python
439439
# -u for unbuffered STDIN and STDOUT
440440
# and the path to the script
@@ -468,8 +468,8 @@ correctly:
468468
service kapacitor restart
469469
```
470470

471-
Check the logs (`/var/log/kapacitor/`) to make sure you see a
472-
*Listening for signals* line and that no errors occurred. If you
471+
Check the logs (`/var/log/kapacitor/` or `journalctl -f -n 256 -u kapacitor.service`) to make sure you see a
472+
_Listening for signals_ line and that no errors occurred. If you
473473
don't see the line, it's because the UDF process is hung and not
474474
responding. It should be killed after a timeout, so give it a moment
475475
to stop properly. Once stopped, you can fix any errors and try again.
@@ -544,6 +544,20 @@ the Kapacitor task:
544544
kapacitor define print_temps -tick print_temps.tick
545545
```
546546

547+
Ensure that the task is enabled:
548+
549+
```bash
550+
kapacitor enable print_temps
551+
```
552+
553+
And then list the tasks:
554+
555+
```bash
556+
kapacitor list tasks
557+
ID Type Status Executing Databases and Retention Policies
558+
print_temps stream enabled true ["printer"."autogen"]
559+
```
560+
547561
### Generating test data
548562

549563
To simulate our printer for testing, we will write a simple Python
@@ -557,7 +571,7 @@ to use real data for testing our TICKscript and UDF, but this is
557571
faster (and much cheaper than a 3D printer).
558572

559573
```python
560-
#!/usr/bin/python2
574+
#!/usr/bin/env python
561575

562576
from numpy import random
563577
from datetime import timedelta, datetime
@@ -672,7 +686,11 @@ fake data so that we can easily iterate on the task:
672686
```sh
673687
# Start the recording in the background
674688
kapacitor record stream -task print_temps -duration 24h -no-wait
675-
# Grab the ID from the output and store it in a var
689+
# List recordings to find the ID
690+
kapacitor list recordings
691+
ID Type Status Size Date
692+
7bd3ced5-5e95-4a67-a0e1-f00860b1af47 stream running 0 B 04 May 16 11:34 MDT
693+
# Copy the ID and store it in a variable
676694
rid=7bd3ced5-5e95-4a67-a0e1-f00860b1af47
677695
# Run our python script to generate data
678696
chmod +x ./printer_data.py

0 commit comments

Comments
 (0)