Verifying Kapacitor Installed by Compiling Source Code
Configuring InfluxDB
Prerequisite: InfluxDB has been installed and initialized successfully. For details about how to install and initialize InfluxDB, see InfluxDB 2.0.3 Porting Guide.
- Go to the InfluxDB compilation directory.
1cd /opt/db/influxdb
- Create a bucket named kapasts in InfluxDB. -r 9h indicates that the data retention period is 9 hours.
1./influx bucket create -n kapasts -r 9h

Viewing the bucket:1./influx bucket list
Deleting the bucket:1./influx bucket delete --name kapasts
- Create a user for connecting to Kapacitor. (Change the ID based on your requirements.)
1./influx v1 auth create --username kapa --password 123456 --write-bucket ID --read-bucket ID

- Create a DBRP mapping for the user to connect to Kapacitor. (Change the ID based on your requirements.)
1./influx v1 dbrp create --bucket-id ID --db kapadb --rp rpv2 --default

Viewing the DBRP mapping:1./influx v1 dbrp list
Deleting the DBRP mapping:1./influx v1 dbrp delete --id ID
Configuring Kapacitor
Prerequisite: Kapacitor has been installed but not started.
- Go to the Kapacitor compilation directory.
1cd /opt/tool/code/src/github.com/influxdata/kapacitor
- There is no default configuration file for compilation. You can run the following command to generate an initial configuration file.
1 2
mkdir /etc/kapacitor/ ./kapacitord config > /etc/kapacitor/kapacitor.conf
- Modify the Kapacitor configuration file, as shown in the following figure. In the preceding command, urls indicates the IP address and port number of the InfluxData service, username and password indicate the user name and password in the influx v1 auth create command, set disable-subscriptions to true, and set subscriptions-mode to cluster.
vi /etc/kapacitor/kapacitor.conf
1 2
disable-subscriptions = true subscriptions-mode = cluster

- Stop the Kapacitor service. (Change the PID based on your requirements.)
1 2
ps -ef | grep kapacitord kill -9 PID
- Start the Kapacitor service.
1nohup ./kapacitord &
Verifying Basic Functions of Kapacitor
- Go to the Kapacitor compilation directory.
1cd /opt/tool/code/src/github.com/influxdata/kapacitor
- Query the database status.
1 2
./kapacitor stats general ./kapacitor stats ingress

- Query the database information.
1./kapacitor list tasks

Parent topic: Verifying Kapacitor