1
0
Fork 0
mirror of https://github.com/anyproto/any-sync-dockercompose.git synced 2025-06-08 05:47:03 +09:00

Merge pull request #27 from anyproto/fix-mongo-unhealthy

fix status 'unhealthy' in mongo replset configuration
This commit is contained in:
Kirill Shklyaev 2024-03-27 16:18:27 +03:00 committed by GitHub
commit 40e5405b26
Signed by: github
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

6
.env
View file

@ -5,9 +5,9 @@ MINIO_PORT=9000
MINIO_WEB_PORT=9001 MINIO_WEB_PORT=9001
ANY_SYNC_NODE_VERSION=latest ANY_SYNC_NODE_VERSION=latest
ANY_SYNC_FILENODE_VERSION=latest ANY_SYNC_FILENODE_VERSION=v0.5.4
ANY_SYNC_COORDINATOR_VERSION=latest ANY_SYNC_COORDINATOR_VERSION=v0.3.14
ANY_SYNC_CONSENSUSNODE_VERSION=latest ANY_SYNC_CONSENSUSNODE_VERSION=v0.1.4
ANY_SYNC_ADMIN_VERSION=latest ANY_SYNC_ADMIN_VERSION=latest
MONGO_VERSION=7.0.2 MONGO_VERSION=7.0.2

View file

@ -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