[SERVER-7136] mongorestore fails to find master of replication set Created: 24/Sep/12  Updated: 10/Dec/14  Resolved: 20/Mar/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.2.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jean-Marie Gaillourdet Assignee: Michael Grundy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.04 LTS, mongodb 2.2.0


Operating System: ALL
Participants:

 Description   

Below is shell session which shows the failure. Note that mongorestore lists
127.0.0.1:27019 as primary and fails to find a master in the next line.

user@host:~$ mongorestore --host 127.0.0.1:27019,127.0.0.1:27018 -d mydb --drop -c User mongo-dump/mydb/User.bson
Mon Sep 24 16:37:31 warning: replica set name empty, first node: 127.0.0.1:27019
Mon Sep 24 16:37:31 starting new replica set monitor for replica set with seed of 127.0.0.1:27019,127.0.0.1:27018
Mon Sep 24 16:37:31 successfully connected to seed 127.0.0.1:27019 for replica set
Mon Sep 24 16:37:31 warning: node: 127.0.0.1:27019 isn't a part of set: ismaster:

{ setName: "REPLICA1", ismaster: true, secondary: false, hosts: [ "localhost:27019", "localhost:27018" ], arbiters: [ "localhost:27020" ], primary: "localhost:27019", me: "localhost:27019", maxBsonObjectSize: 16777216, localTime: new Date(1348497451380), ok: 1.0 }

Mon Sep 24 16:37:31 successfully connected to seed 127.0.0.1:27018 for replica set
Mon Sep 24 16:37:31 warning: node: 127.0.0.1:27018 isn't a part of set: ismaster:

{ setName: "REPLICA1", ismaster: false, secondary: true, hosts: [ "localhost:27018", "localhost:27019" ], arbiters: [ "localhost:27020" ], primary: "localhost:27019", me: "localhost:27018", maxBsonObjectSize: 16777216, localTime: new Date(1348497451381), ok: 1.0 }

Mon Sep 24 16:37:33 warning: No primary detected for set
Mon Sep 24 16:37:33 All nodes for set are down. This has happened for 1 checks in a row. Polling will stop after 29 more failed checks
Mon Sep 24 16:37:33 replica set monitor for replica set started, address is
Mon Sep 24 16:37:33 [ReplicaSetMonitorWatcher] starting
Mon Sep 24 16:37:35 warning: No primary detected for set
couldn't connect to [127.0.0.1:27019,127.0.0.1:27018] connect failed to set 127.0.0.1:27019,127.0.0.1:27018
Logstream::get called in uninitialized state
Mon Sep 24 16:37:35 deleting replica set monitor for:
user@host:~$



 Comments   
Comment by Michael Grundy [ 11/Mar/13 ]

Hi -

Are you still running into this issue? I noticed you were running version 2.2.0 when you initially posted this. We've fixed some critical bugs in 2.2.0 since then and recommend you update to the latest stable release of 2.2, which is 2.2.3, as soon as possible.

If you are still seeing this issue with 2.2.3, I'd recommend posting on one of our free support channels. Filing tickets under the SERVER project is not the best way to get visibility for issues you encounter, as we use this project for tracking bugs and feature requests. If you have a support contract with 10gen, then filing commercial support tickets is your best option. If not, the 10gen development and support teams actively monitor posts to stackoverflow (http://stackoverflow.com/questions/tagged/mongodb) and to the mongo google group (https://groups.google.com/forum/?fromgroups#!forum/mongodb-user)

Mike

Comment by Jean-Marie Gaillourdet [ 24/Sep/12 ]

I'll make another run to copy the output and post it here.

Comment by Jean-Marie Gaillourdet [ 24/Sep/12 ]

Oh, yes. I noticed that now as well. But, when I do that, mongorestore still fails as soon as the master switches.

Comment by Randolph Tan [ 24/Sep/12 ]

Hi,

To specify a replica set as your target, use the replica set connection string, which looks like this:

replSet/host1,host2,host3

so in your case, it will look like this:

 mongorestore --host REPLICA1/127.0.0.1:27019,127.0.0.1:27018 -d mydb --drop -c User mongo-dump/mydb/User.bson 

Generated at Thu Feb 08 03:13:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.