You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run docker-compose up, some times sevel container boot crash.
2020-11-26T07:59:10.584+0000 I CONTROL [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27017, tls: { mode: "disabled" } }, processManagement: { fork: true, pidFilePath: "/tmp/docker-entrypoint-temp-mongod.pid" }, security: { keyFile: "/mongodb.key" }, systemLog: { destination: "file", logAppend: true, path: "/proc/1/fd/1", quiet: true } }
2020-11-26T07:59:10.585+0000 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
......
2020-11-26T07:59:10.585+0000 I CONTROL [initandlisten] shutting down with code:48
That's because container will create a mongod init process which always using port 27017. The init process will last for about one second. If sevel mongo container boot at the same time, Only one init process can bind 27017, other will crash.
The text was updated successfully, but these errors were encountered:
If you're using the host network mode then you'll have to stagger the initializations or pre-initialize them as the entrypoint will temporarily be listening on 27017
Here's part of my docker-compose.yaml:
When I run
docker-compose up
, some times sevel container boot crash.That's because container will create a mongod init process which always using port 27017. The init process will last for about one second. If sevel mongo container boot at the same time, Only one init process can bind 27017, other will crash.
The text was updated successfully, but these errors were encountered: