RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.39k stars 10.51k forks source link

$MONGO_OPLOG_URL must be set to the 'local' database of a Mongo replica set #6963

Closed solairerove closed 7 years ago

solairerove commented 7 years ago

https://raw.githubusercontent.com/RocketChat/Rocket.Chat/develop/docker-compose.yml not work

geekgonecrazy commented 7 years ago

@solairerove take everything down via: docker-compose down

Then start them up one by one in this order: docker-compose up -d mongo - give it a minute to start docker-compose up -d mongo-init-replica - give this one a minute to start as well.

Then finally: docker-compose up -d should bring the rest of the stack up.

solairerove commented 7 years ago

it's working, thanks!

chris-aeviator commented 4 years ago

This just happened to me with no change to the environment overnight - I'm glad it happened on a dev machine, but it renders my perfectly setup livechat environment with integrations useless overnight. The above commands not yield any success, as the mongo-init-replica errors that it has been already been initialized.

ongo-init-replica_1  | MongoDB shell version v4.0.18
mongo-init-replica_1  | connecting to: mongodb://mongo:27017/rocketchat?gssapiServiceName=mongodb
mongo-init-replica_1  | Implicit session: session { "id" : UUID("e5474f2c-9db2-40e5-8b3a-c699eeacc757") }
mongo-init-replica_1  | MongoDB server version: 4.0.18
mongo-init-replica_1  | {
mongo-init-replica_1  |         "operationTime" : Timestamp(1589086563, 1),
mongo-init-replica_1  |         "ok" : 0,
mongo-init-replica_1  |         "errmsg" : "already initialized",
mongo-init-replica_1  |         "code" : 23,
mongo-init-replica_1  |         "codeName" : "AlreadyInitialized",
mongo-init-replica_1  |         "$clusterTime" : {
mongo-init-replica_1  |                 "clusterTime" : Timestamp(1589086563, 1),
mongo-init-replica_1  |                 "signature" : {
mongo-init-replica_1  |                         "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
mongo-init-replica_1  |                         "keyId" : NumberLong(0)
mongo-init-replica_1  |                 }
mongo-init-replica_1  |         }
mongo-init-replica_1  | }

EDIT:

geekgonecrazy commented 4 years ago

Has to be different situation. Since this issue would only happen on first startup. Never would show randomly While running. Also your output proves mongo already has replicaSet.

Make sure you don’t have multiple mongos running. Can often happen when iterating in dev environment. If another mongo instance came up with no replicaset initialized this would happen.

If still have repeatable situation please open new issue with steps to reproduce

chris-aeviator commented 4 years ago

@geekgonecrazy it was indeed a separate mongo instance that started up with my docker daemon

geekgonecrazy commented 4 years ago

It happens :) glad you got it