轉載請註明出處:
1.使用以下命令下載安裝包:
wget https://dl.influxdata.com/kapacitor/releases/kapacitor_1.6.3-1_amd64.deb
然後,執行以下命令來安裝下載的包:
sudo dpkg -i kapacitor_1.6.3-1_amd64.deb
2.安裝完成後,現在啟用Kapacitor(系統啟動時自動啟動),啟動並使用以下命令驗證狀態:
sudo systemctl start kapacitor
sudo systemctl enable kapacitor
sudo systemctl status kapacitor
3.要驗證Kapacitor版本,請使用以下命令進行確認:
kapacitor version
4.修改設定
Kapacitor的組態檔是TOML格式的,預設儲存在/etc/kapacitor/kapacitor.conf
。如果您將組態檔儲存在其他位置,啟動Kapacitor時需要指定該位置。
修改完成後,需要重啟kapacitor服務。
sudo systemctl restart kapacitor
使用docker compose編排服務:
version: '3.6'
services:
kapacitor:
image: kapacitor:1.6.3
environment:
- TZ=Asia/Shanghai
volumes:
- type: bind
source: /var/data/kapacitor/kapacitor.db
target: /var/lib/kapacitor/kapacitor.db
- type: bind
source: /var/data/kapacitor/kapacitor.conf
target: /etc/kapacitor/kapacitor.conf
ports:
- published: 9092
target: 9092
mode: host
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "20m"
啟動服務:
docker-compose -f /var/data/kapacitor/docker-compose.yml up -d
停止服務:
docker-compose -f /var/data/kapacitor/docker-compose.yml down