mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 14:07:02 +09:00
fix status 'unhealthy' in mongo replset configuration
This commit is contained in:
parent
939e832130
commit
75eb15ba34
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage/mongo-1/:/data/db
|
- ./storage/mongo-1/:/data/db
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: test $$(echo "rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:\"mongo-1:${MONGO_1_PORT}\"},{_id:1,host:\"mongo-2:${MONGO_2_PORT}\"},{_id:2,host:\"mongo-3:${MONGO_3_PORT}\"}]}).ok || rs.status().ok" | mongosh --port ${MONGO_1_PORT} --quiet) -eq 1
|
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:'mongo-1:${MONGO_1_PORT}'},{_id:1,host:'mongo-2:${MONGO_2_PORT}'},{_id:2,host:'mongo-3:${MONGO_3_PORT}'}]}) }" | mongosh --port ${MONGO_1_PORT} --quiet
|
||||||
interval: 10s
|
interval: 10s
|
||||||
start_period: 30s
|
start_period: 30s
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue