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 anotherEXPONENTIAL_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 afterEXPONENTIAL_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
- Host of your kafka connect cluster (without
http
orhttps
and any/
at the end and also port)
- Host of your kafka connect cluster (without
KAFKA_CONNECT_PORT
: Default =8083
- Port of kafka connect cluster for rest api
KAFKA_CONNECT_PROTO
: Default =http
- Protocol for kafka connect host. Should be
http
andhttps
- Protocol for kafka connect host. Should be
KAFKA_CONNECT_USER
: Default =''
KAFKA_CONNECT_PASS
: Default =''
ENABLE_BACKOFF
: Default =1
- Whether restart back off mechanism should be enabled of not
- You should specify this with
0
or1
every other value considered as1
MAX_RESTART
: Default =7
- Maximum number of continuous restart for each connector
- Must be integer greater than 0
EXPONENTIAL_RATIO
: Default =2
- Exponential ratio to increase sleep between each connector restart.
- Must be integer greater than 0
Note: Set values for KAFKA_CONNECT_USER
and KAFKA_CONNECT_PASS
only if Kafka Connect cluster need basic authentication otherwise don't set them.
See CHANGELOG.md