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
Step to reproduce docker run --rm -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root mongo:5.0.3 mongod --shardsvr --replSet a
or docker run --rm -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root mongo:5.0.3 mongod --configsvr --replSet a
Actual result
BadValue: Cannot start a shardsvr as a standalone server. Please use the option --replset to start the node as a replica set.
try 'mongod --help' for more information
it doesn't make sense to try to add an admin user/pass to a shard server, since they don't store the admin database (that's on the config server). It also doesn't make sense to try to run any scripts in /docker-entrypoint-initdb.d/, since, as far as I understand it, you need to go through a mongos server in order to talk to a sharded cluster.
so, we should probably adjust the entrypoint script to either warn & ignore if any of that is attempted on a shardsvr or just error out if they are supplied with shardsvr
as for user/pass with configsvr, that still works for 4.4, but replica set being required in 5.0 complicates things.
since replSet does not work correctly on the temporary mongod server, we should also remove configsvr but preserve its default dbPath for the temporary mongod server so that data is in the correct location
Step to reproduce
docker run --rm -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root mongo:5.0.3 mongod --shardsvr --replSet a
or
docker run --rm -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root mongo:5.0.3 mongod --configsvr --replSet a
Actual result
Starts from 5.0.3 mongod requires replica set for
shardsvr
orconfigsvr
cluster role (issue - https://jira.mongodb.org/browse/SERVER-27383)It is caused by this code: https://github.com/docker-library/mongo/blob/master/5.0/docker-entrypoint.sh#L286
The text was updated successfully, but these errors were encountered: