Skip to content

Commit

Permalink
add a health check to fix the issue with cassandra falling over on st…
Browse files Browse the repository at this point in the history
…aging
  • Loading branch information
timcowlishaw committed Dec 1, 2023
1 parent 3f16240 commit 283d138
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compose/cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ services:
# docker compose exec cassandra-1 nodetool status
cassandra-1:
image: cassandra:3.11.4
healthcheck:
test: ["CMD-SHELL", "[ $$(nodetool statusgossip) = running ]"]
interval: 30s
start_period: 30s
timeout: 10s
retries: 5
ports:
# no need to expose all ports?
- "7000:7000" # Internode, cluster communication
Expand Down
3 changes: 3 additions & 0 deletions compose/kairos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ services:
build:
context: ../scripts/
dockerfile: Dockerfile-kairos
depends_on:
cassandra-1:
condition: service_healthy
deploy:
restart_policy:
condition: on-failure
Expand Down

0 comments on commit 283d138

Please sign in to comment.