rs.initiate(...) in 3.4.2 - CannotInitializeNodeWithData

1,003 views
Skip to first unread message

Doug Reese

unread,
Feb 8, 2017, 8:59:51 PM2/8/17
to mongodb-user
Hi all,

I have 3 vagrant virtualbox VMs based on Ubuntu 14.04.5 LTS, all newly created with "vagrant up," and the result of rs.initate(...) in MongoDB 3.4.2 complains that some members already have data.

rs.initiate({ _id: "rs01", version: 1, members: [ 
  {_id: 0, host:"192.168.33.10:27017"}, 
  {_id: 1, host:"192.168.33.11:27017"}, 
  {_id: 2, host:"192.168.33.12:27017"} 
]})
{
        "ok" : 0,
        "errmsg" : "'192.168.33.11:27017' has data already, cannot initiate set.",
        "code" : 110,
        "codeName" : "CannotInitializeNodeWithData"
}

If I remove members 1 and 2 from the rs.initiate(...) command, then add members 1 and 2 using rs.add(...), everything works fine.  I have verified there is no existing data in any of the members before the rs.initiate(...) command.

If I fall back to MongoDB 3.2.x the rs.initiate(...) with all three members works as expected with no error.  I have not found any other reports of this happening.

Doug

Asya Kamsky

unread,
Feb 13, 2017, 9:32:55 AM2/13/17
to mongod...@googlegroups.com
You might want to file a SERVER ticket for this in jira.mongodb.org

Asya

--


You received this message because you are subscribed to the Google Groups "mongodb-user"


group.


 


For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/


---


You received this message because you are subscribed to the Google Groups "mongodb-user" group.


To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.


To post to this group, send email to mongod...@googlegroups.com.


Visit this group at https://groups.google.com/group/mongodb-user.


To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/aee9f52b-33bd-4f42-88c0-0950386908a4%40googlegroups.com.


For more options, visit https://groups.google.com/d/optout.


Asya Kamsky

unread,
Feb 13, 2017, 11:42:27 AM2/13/17
to mongodb-user
I was not able to reproduce the problem of rs.initiate(<config>) failing when the instances were all new.

Are you certain about no existing data?  How did you check that?

Asya


On Mon, Feb 13, 2017 at 9:32 AM, Asya Kamsky <as...@mongodb.com> wrote:
You might want to file a SERVER ticket for this in jira.mongodb.org

Asya
On Wed, Feb 8, 2017 at 17:59 Doug Reese <do...@reesesystems.com> wrote:
Hi all,

I have 3 vagrant virtualbox VMs based on Ubuntu 14.04.5 LTS, all newly created with "vagrant up," and the result of rs.initate(...) in MongoDB 3.4.2 complains that some members already have data.





rs.initiate({ _id: "rs01", version: 1, members: [ 
  {_id: 0, host:"192.168.33.10:27017"}, 
  {_id: 1, host:"192.168.33.11:27017"}, 
  {_id: 2, host:"192.168.33.12:27017"} 
]})
{

        "ok" : 0,

        "errmsg" : "'192.168.33.11:27017' has data already, cannot initiate set.",

        "code" : 110,

        "codeName" : "CannotInitializeNodeWithData"

}

If I remove members 1 and 2 from the rs.initiate(...) command, then add members 1 and 2 using rs.add(...), everything works fine.  I have verified there is no existing data in any of the members before the rs.initiate(...) command.

If I fall back to MongoDB 3.2.x the rs.initiate(...) with all three members works as expected with no error.  I have not found any other reports of this happening.

Doug









--


You received this message because you are subscribed to the Google Groups "mongodb-user"


group.


 


For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/


---


You received this message because you are subscribed to the Google Groups "mongodb-user" group.


To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.



--
Asya Kamsky
Lead Product Manager
MongoDB
Download MongoDB - mongodb.org/downloads
We're Hiring! - https://www.mongodb.com/careers

Uma Ragupathy

unread,
Mar 8, 2017, 12:08:02 AM3/8/17
to mongodb-user
Even I am facing the same problem.

Scenario is 

Creating three brand new AWS instances and configuring the replicaset in runtime by editing the /etc/mongod.conf from the Userdata. Instances are up but replicaset creation fails with the above error.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.

Wan Bachtiar

unread,
Mar 16, 2017, 8:21:04 PM3/16/17
to mongodb-user

Creating three brand new AWS instances and configuring the replicaset in runtime by editing the /etc/mongod.conf from the Userdata. Instances are up but replicaset creation fails with the above error.

Hi Uma,

Although you're seeing the same error message, it may not be the same cause of issue.

Looking at the code for this error message on check_quorum_for_config_change.cpp (v3.4) , this is a safety check to ensure that none of the members has data before joining the replica set. As initial-sync may have wiped any existing data.

Please check your script(s) or process, whether perhaps you launched mongod without --replSet defined. i.e. part of service or init .

To help others to reproduce your issue, could you please answer the following:

  • What is your specific MongoDB version ?

  • What is your AWS instances' Operating System ?

  • What do you mean by "configure the replica set in runtime" ?

  • What is the content of /etc/mongod.conf ?

  • Did you restart any mongod process in your script ?

Regards,

Wan.  

mchow...@gmail.com

unread,
Jun 8, 2017, 5:43:43 PM6/8/17
to mongod...@googlegroups.com
I am also facing the same issue. Did anybody resolved this?

What is your specific MongoDB version ? - MongoDB shell version v3.4.4

What is your AWS instances' Operating System ? - Amazon Linux

Did you restart any mongod process in your script ? No, I have restarted
manually.

What is the content of /etc/mongod.conf ?

# mongod.conf

# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:

# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile

# network interfaces
net:
port: 27017
# bindIp: 127.0.0.1,13.58.225.174,13.58.180.226 # Listen to
local interface only, comment to listen on all interfaces.


#security:

#operationProfiling:

replication:
replSetName: rs0




--
View this message in context: http://mongodb.2344371.n4.nabble.com/rs-initiate-in-3-4-2-CannotInitializeNodeWithData-tp14470p16150.html
Sent from the User mailing list archive at Nabble.com.
Reply all
Reply to author
Forward
0 new messages