-
Notifications
You must be signed in to change notification settings - Fork 650
Initializing replicaset with default configuration (single node) fails. #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can't reproduce (taking into account #180 / #222 by adding $ docker pull mongo:3.6
3.6: Pulling from library/mongo
Digest: sha256:785f81e5cf14e8c2f6989bdf276cb025b076a8403f96f6ed45c8ec8161913fdd
Status: Image is up to date for mongo:3.6
$ docker run -dit --name mongo --hostname mongo mongo:3.6 --bind_ip_all --replSet some-repl
5469769e0ae207d70f6e5b09642dcac23acee7707aaa5c7aaafc2d3e32b702fc
$ docker logs --tail=2 mongo
2017-12-15T04:20:49.167+0000 I REPL [initandlisten] Did not find local replica set configuration document at startup; NoMatchingDocument: Did not find replica set configuration document in local.system.replset
2017-12-15T04:20:49.167+0000 I NETWORK [initandlisten] waiting for connections on port 27017
$ docker exec -it mongo mongo admin
MongoDB shell version v3.6.0
connecting to: mongodb://127.0.0.1:27017/admin
MongoDB server version: 3.6.0
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2017-12-15T04:20:49.069+0000 I STORAGE [initandlisten]
2017-12-15T04:20:49.069+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-12-15T04:20:49.069+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-12-15T04:20:49.109+0000 I CONTROL [initandlisten]
2017-12-15T04:20:49.109+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-12-15T04:20:49.109+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-12-15T04:20:49.109+0000 I CONTROL [initandlisten]
2017-12-15T04:21:14.144+0000 E - [main] Error loading history file: FileOpenFailed: Unable to fopen() file /root/.dbshell: No such file or directory
> rs.initiate()
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "mongo:27017",
"ok" : 1,
"operationTime" : Timestamp(1513311677, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1513311677, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
some-repl:SECONDARY> rs.status()
{
"set" : "some-repl",
"date" : ISODate("2017-12-15T04:21:58.368Z"),
"myState" : 1,
"term" : NumberLong(1),
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(1513311709, 1),
"t" : NumberLong(1)
},
"readConcernMajorityOpTime" : {
"ts" : Timestamp(1513311709, 1),
"t" : NumberLong(1)
},
"appliedOpTime" : {
"ts" : Timestamp(1513311709, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(1513311709, 1),
"t" : NumberLong(1)
}
},
"members" : [
{
"_id" : 0,
"name" : "mongo:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 69,
"optime" : {
"ts" : Timestamp(1513311709, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2017-12-15T04:21:49Z"),
"infoMessage" : "could not find member to sync from",
"electionTime" : Timestamp(1513311677, 2),
"electionDate" : ISODate("2017-12-15T04:21:17Z"),
"configVersion" : 1,
"self" : true
}
],
"ok" : 1,
"operationTime" : Timestamp(1513311709, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1513311709, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
} |
In my case mongo server name is blank, thats what causing it to fail. "me" : ":27017", You think this could be happening because I dont have flag --bind_ip_all, My setup used to work until my kubernetes pod spec starting picking latest which is 3.6. When I moved back to older version mongo:3.4.10-jessie, its working again fine for me. Thanks, |
I _know_ it's definitely happening because of that missing flag. If you
check your logs on "rs.initiate()", you should have a warning of that very
fact (which says something to the effect of missing "--bind_ip_all" or
"--bind_ip").
|
Initializing replicaset with default configuration (single node) fails. MongoDB server version: 3.6.0
The text was updated successfully, but these errors were encountered: