Transform data from CSV files with Pandas in Python containers (in parallel)
Process a list of CSV files in parallel, each in its own isolated Python and Pandas container.
Check Redis replicas for missing links, lag and replica-read-only off, alert Slack, and set replica-read-only back on with CONFIG SET and verify.
Redis replication fails quietly:
replicaof is now a standalone primary serving stale data;replica-read-only no for a test, and a client wrote session data to it, which the next full resync deletes without a trace.Sentinel or the client library keeps working, so nobody notices until a failover promotes the replica that was behind.
This blueprint reads INFO replication on the primary and on every expected replica, plus replica-read-only on each replica. It alerts Slack on anything off, and can set replica-read-only back to yes with CONFIG SET, then read the setting again to verify.
This blueprint was created by zkasuran.
| Finding | Severity | Rule | Fix |
|---|---|---|---|
PRIMARY_NOT_MASTER |
Critical | The primary host reports a role other than master |
Report only |
MISSING_REPLICAS |
High | Fewer connected_slaves than expected replicas |
Report only |
REPLICA_UNREACHABLE |
High | No INFO reply from a replica |
Report only |
NOT_A_REPLICA |
High | An expected replica reports role master |
Report only |
LINK_DOWN |
High | master_link_status is not up |
Report only |
REPLICA_LAG |
Medium | The replica's offset is more than max_lag_bytes behind the primary's |
Report only |
REPLICA_WRITABLE |
High | replica-read-only is no |
CONFIG SET replica-read-only yes |
Only the writable replica is fixed automatically. Re-pointing a replica or forcing a resync changes data, and is left to a person.
primary_info (io.kestra.plugin.redis.cli.RedisCLI, read-only) runs INFO replication on the primary.replicas_info (io.kestra.plugin.core.flow.Loop) runs INFO replication and CONFIG GET replica-read-only on each replica. An unreachable replica does not stop the others.findings parses every reply and applies the rules in one jq expression. summary logs the result.route (io.kestra.plugin.core.flow.If):alert posts to Slack.remediate_gate runs only when auto_remediate is true, dry_run is false, and a replica is writable.remediate (concurrencyLimit: 1) runs CONFIG SET replica-read-only yes and then reads the setting back.verify_result fails if any replica is still writable.errors alerts Slack when the flow fails, for example on an unreachable primary.RedisCLI across several hosts in a Loop.Each INFO replication answers for one node at one moment. Kestra queries every node of the group on a schedule, compares the primary's view with each replica's, and sends the gaps to Slack. It applies the one safe fix behind auto_remediate and dry_run, verifies it, and keeps a history that shows when each replica fell behind or disconnected.
On Kestra 2.0.5 OSS against Redis 7 containers (one primary and replicas started with --replicaof), with a local HTTP sink standing in for Slack.
| Run | Setup | Result |
|---|---|---|
| 1 | One replica started with --replica-read-only no |
1 finding, REPLICA_WRITABLE. Alert sent |
| 2 | same, dry run | Same finding. CONFIG GET replica-read-only still no |
| 3 | same, remediate | Set and verified. SET on the replica now returns READONLY You can't write against a read only replica |
| 4 | healthy | No finding |
| 5 | One replica promoted with REPLICAOF NO ONE, the other stopped |
MISSING_REPLICAS (0 of 2), NOT_A_REPLICA, REPLICA_UNREACHABLE |
| 6 | Primary password changed, replica with a wrong masterauth, 1.5 MB written |
MISSING_REPLICAS, LINK_DOWN, REPLICA_LAG of 57,797,753 bytes. The flow authenticated with REDIS_PASSWORD |
| 7 | Unknown primary host | errors alert sent |
RedisCLI tasks start. CONFIG must be allowed on the replicas for remediation.docker run -d --name redis-primary redis:7-alpine;docker run -d --name redis-replica-1 redis:7-alpine redis-server --replicaof redis-primary 6379 --replica-read-only no, on the same Docker network.SLACK_WEBHOOK_URL: used by alert and the errors block.REDIS_PASSWORD: only when use_password is true.SECRET_.| Input | Default | Purpose |
|---|---|---|
primary_host |
redis-primary |
Primary |
replica_hosts |
2 example replicas | Expected replicas |
port |
6379 |
Port on every node |
max_lag_bytes |
1048576 |
Lag threshold |
use_password |
false |
Authenticate to the primary |
network |
empty | Docker network for the redis-cli containers |
auto_remediate |
false |
Allow CONFIG SET replica-read-only yes |
dry_run |
true |
Must be false for a change to apply |
SLACK_WEBHOOK_URL secret, and REDIS_PASSWORD if the primary requires one.primary_host, replica_hosts and, if Redis runs in Docker, network.auto_remediate: true and dry_run: false to make writable replicas read-only, then persist the setting.every_5_minutes trigger, which always runs in safe mode.SENTINEL get-master-addr-by-name) instead of a fixed primary_host.min-replicas-to-write on the primary, so writes stop when replicas are gone.CONFIG REWRITE after the fix when your nodes use a writable config file.NOT_A_REPLICA and LINK_DOWN instead of a Slack message.