anvaari/connector-guardian
Guardian for your Kafka Connect connectors.
69
Guardian you need for your Kafka Connect connectors.
Connector's Guardian interact with Kafka Connect cluster using its rest api and parse returned json with jq (in version 0.1.0) and with json library in python (from version0.2.0).
Auto Connector Restart: It check status of connectors and tasks and restart if they are failed. Available from V0.1.0
Restart Back Off: The restarts will happen always after an increasing time period. The first restart will happen immediately at first run. If it does not help, the next restart will happen only after EXPONENTIAL_RATIO ^ 1
run. If even the second restart doesn’t help, the next restart will be done only after another EXPONENTIAL_RATIO ^ 1
run. And so on. This leaves more time for the root cause of the failure to be resolved. Thanks to this back-off mechanism, even if the network outage takes over these minutes, the auto-restart will help your connectors to recover from it. The last Restart (= MAX_RESTART
) restart will happen after EXPONENTIAL_RATIO ^ 1
run from the initial failure. But if the issue is not resolved even after the last restart, the Guardian will stop restarting and it is up to you to solve it manually. Available from V0.3.0
You can pull image from Docker hub:
You can use provided docker-compose to deploy connector guardian in your server
Before deploying image, make sure to set appropriate environment variables in docker-compose.yaml
cd deploy
docker compose up -d
You can use provided helm chart: (You can see guid for install helm here)
Before deploying chart, make sure to set appropriate environment variables in values.yaml
helm upgrade connector-guardian --install -n {your_namespace_name} -f deploy/chart/values.yaml deploy/chart
After deploying, it creates 1 pod which run a connector_guardian.py
every 5 minutes.
In order to use Docker image, docker-compose or helm chart, you need to set some environment variables:
KAFKA_CONNECT_HOST
: Default = localhost
http
or https
and any /
at the end and also port)KAFKA_CONNECT_PORT
: Default = 8083
KAFKA_CONNECT_PROTO
: Default = http
http
and https
KAFKA_CONNECT_USER
: Default = ''
KAFKA_CONNECT_PASS
: Default = ''
ENABLE_BACKOFF
: Default = 1
0
or 1
every other value considered as 1
MAX_RESTART
: Default = 7
EXPONENTIAL_RATIO
: Default = 2
Note: Set values for KAFKA_CONNECT_USER
and KAFKA_CONNECT_PASS
only if Kafka Connect cluster need basic authentication otherwise don't set them.
First version of connector guardian which use simple bash script which restart failed connector and task in each run
docker-compose.yaml
so connector guardian can be used for non-cloud environmentKAFKA_CONNECT_PROTO
changed to KAFKA_CONNECT_PROTOCOL
EXPONENTIAL_RATIO
to 2docker pull anvaari/connector-guardian