Closed zcr268 closed 3 months ago
Can I use MongoDB 4.4.29?
Hey! A fix will be released soon to allow mongo 4.x versions to be used in replica set mode.
Hey! A fix will be released soon to allow mongo 4.x versions to be used in replica set mode.
Waiting for this for a long long time TAT. Do plz release this fix soon
Sorry for the long wait! So, in older versions of Mongo, the initialization of the Replica Set was arranged differently. In order for legacy MongoDB to work, you need to do the following:
.env
file, set new values for the following variables:
MONGO_VERSION=4.4.29
MONGO_CONNECT=mongodb://mongo-1:${MONGO_1_PORT}
version: "3.9"
services: mongo-1: image: "mongo:${MONGO_VERSION}" command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_1_PORT} ports:
./storage/mongo-1/:/data/db healthcheck: test: mongo --port ${MONGO_1_PORT} --eval 'rs.initiate({"_id":"${MONGO_REPLICA_SET}","members":[{"_id":0,"host":"mongo-1:${MONGO_1_PORT}"}]})' interval: 10s start_period: 30s
redis: image: "redis/redis-stack-server:${REDIS_VERSION}" restart: always command: redis-server --dir /data/ --appendonly yes --maxmemory 256mb --maxmemory-policy noeviction --protected-mode no --loadmodule /opt/redis-stack/lib/redisbloom.so ports:
./storage/redis/:/data/ healthcheck: test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] interval: 10s timeout: 30s retries: 3
minio: image: "minio/minio:${MINIO_VERSION}" restart: always command: server /data --console-address ":9001" environment: MINIO_ROOT_USER: "${AWS_ACCESS_KEY_ID}" MINIO_ROOT_PASSWORD: "${AWS_SECRET_ACCESS_KEY}" ports:
./storage/minio:/data healthcheck: test: bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1 interval: 5s timeout: 10s retries: 3 networks: default: aliases:
create-bucket: image: minio/mc:latest environment: MC_HOST_minio: http://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}@minio:${MINIO_PORT} restart: no depends_on:
mc mb minio/${MINIO_BUCKET}
any-sync-coordinator_bootstrap: image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}" depends_on:
./etc/any-sync-coordinator/:/etc/any-sync-coordinator/ restart: no command: bash -c "sleep 10; /bin/any-sync-confapply -c /etc/any-sync-coordinator/config.yml -n /etc/any-sync-coordinator/network.yml -e"
any-sync-coordinator: image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}" depends_on:
./storage/networkStore/any-sync-coordinator/:/networkStore/ deploy: resources: limits: memory: 500M restart: on-failure command: bash -c "sleep 10; /bin/any-sync-coordinator -c /etc/any-sync-coordinator/config.yml"
any-sync-filenode: image: "ghcr.io/anyproto/any-sync-filenode:${ANY_SYNC_FILENODE_VERSION}" depends_on:
./storage/networkStore/any-sync-filenode/:/networkStore/ deploy: resources: limits: memory: 500M restart: on-failure command: bash -c "sleep 15; /bin/any-sync-filenode -c /etc/any-sync-filenode/config.yml"
any-sync-node-1: image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}" depends_on:
./storage/networkStore/any-sync-node-1/:/networkStore/ deploy: resources: limits: memory: 500M restart: on-failure command: bash -c "sleep 15; /bin/any-sync-node -c /etc/any-sync-node/config.yml"
any-sync-node-2: image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}" depends_on:
./storage/networkStore/any-sync-node-2/:/networkStore/ deploy: resources: limits: memory: 500M restart: on-failure command: bash -c "sleep 15; /bin/any-sync-node -c /etc/any-sync-node/config.yml"
any-sync-node-3: image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}" depends_on:
./storage/networkStore/any-sync-node-3/:/networkStore/ deploy: resources: limits: memory: 500M restart: on-failure command: bash -c "sleep 15; /bin/any-sync-node -c /etc/any-sync-node/config.yml"
any-sync-consensusnode: image: "ghcr.io/anyproto/any-sync-consensusnode:${ANY_SYNC_CONSENSUSNODE_VERSION}" depends_on:
./storage/networkStore/any-sync-consensusnode/:/networkStore/ deploy: resources: limits: memory: 500M restart: on-failure command: bash -c "sleep 15; /bin/any-sync-consensusnode -c /etc/any-sync-consensusnode/config.yml"
any-sync-admin: image: "ghcr.io/anyproto/any-sync-admin:${ANY_SYNC_ADMIN_VERSION}" depends_on:
The replica-set initalization command has been changed here and the mongo-2 and mongo-3 services have been removed.
make start
. Make sure the replica-set is initialized correctly:
the command docker compose exec mongo-1 mongo --port 27001 --eval 'rs.status().ok'
output must end with 1
.now we have lighter way for use mongo 4 follow to steps:
MONGO_VERSION=4.4.29
services:
mongo-1:
healthcheck:
test: echo "rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:\"mongo-1:${MONGO_1_PORT}\"}]}).ok || rs.status().ok" | mongo --port ${MONGO_1_PORT} --quiet
make start
Have you read a contributing guide?
Current Behavior
MongoDB does not work on older devices above version 5.0
Expected Behavior
MongoDB does not work on older devices above version 5.0
Steps To Reproduce
MongoDB does not work on older devices above version 5.0
Environment
Anything else?
WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that! see https://jira.mongodb.org/browse/SERVER-54407 see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2 see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814