I am having trouble setting up replication on a new mongoDB installation. Everything works fine when I run without replication but when I run mongod with the --replSet option, and run rs.initiate(), this command hangs. Note that I am only running a single instnace of mongod in this example. No other instances are yet running.

In the logfile, I see:

Wed Aug 15 10:02:04 [conn2] run command admin.$cmd { replSetInitiate: { _id: "regression_data", members: [ { _id: 0.0, host: "nradmin.icd.teradyne.com:27017" } ] } }
Wed Aug 15 10:02:04 [conn2] command: { replSetInitiate: { _id: "regression_data", members: [ { _id: 0.0, host: "nradmin.icd.teradyne.com:27017" } ] } }
Wed Aug 15 10:02:04 [conn2] replSet replSetInitiate admin command received from client
Wed Aug 15 10:02:04 [conn2] replSet replSetInitiate config object parses ok, 1 members specified
Wed Aug 15 10:02:04 [conn2] replSet replSetInitiate all members seem up
Wed Aug 15 10:02:11 [conn1] runQuery called local.system.replset {}
Wed Aug 15 10:02:21 [rsStart] Socket recv() timeout
Wed Aug 15 10:02:21 [rsStart] SocketException: remote: error: 9001 socket exception [3] server []
Wed Aug 15 10:02:21 [rsStart] DBClientCursor::init call() failed
Wed Aug 15 10:02:21 [rsStart] User Assertion: 10276:DBClientBase::findN: transport error: localhost:27017 query: {}
Wed Aug 15 10:02:21 [rsStart] runQuery called local.system.replset {}

I have played with the bind_ip option a bit but had no luck.

Here is my current config file:

dbpath = /hwnet/mongodb/regression_data/replica0
replSet = regression_data/nradmin.icd.teradyne.com
logpath = /hwnet/mongodb/regression_data/mongodb_r0.log
verbose = true
vvvvv = true
rest = true
fork = true

This is running on my work network. I did try the same setup on a standalone Mac installation and the rs.initiate() command works perfectly.

Does anyone have any idea what I should be looking at here? I'm running out of ideas.

  • Did you try using localhost instead of Aug 15, 2012 at 15:38
  • @asya I don't explicitly call out anywhere in the config file. I'm not sure where I could make this change. From my understanding, the bind_ip option requires a real IP address. I did try to explicitly set this to as well as point it to a DNS server. The first case made no difference and the latter case caused mongod to crash and never really get running.
    – Bill Peregoy
    Aug 15, 2012 at 18:38

2 Answers 2


I was able to get a solution for this problem on the mongoDB google group. Explicitly setting the oplogSize parameter in my config file solved the problem. By default, mongod tries to allocate 5% of the free space on the storage partition. I have my data on a very large shared disk and this seemed to be taking a long time. I manually set this value and the replica set came up quickly.


First of all - why do you make a replica set composed of only one member ? Replica sets are meant to add redundancy ... you can't really do it with one member.

Second from the log you sent looks like the server doesn't respond anymore.

Be aware that at the initiation time a replica set will try to pre-allocate up to 5% for the capped collection - oplog on 64 bits systems. So if you have a large disk wait until all files are allocated - filled with zeros :). To tune it use --oplogSize.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy