Replication init error

49 views
Skip to first unread message

Daniel Blondowski

unread,
Jun 11, 2014, 11:37:42 AM6/11/14
to mongod...@googlegroups.com
New to Mongo.  Installed 2.6.1.  Working on setting up replication on 3 nodes.

I set replSet=xxx on all 3 nodes and restarted mongo service (service mongos stop/start).

Logged in on primary node:
MongoDB shell version: 2.6.1
connecting to: test
> use admin
switched to db admin
> rs.initiate()
{
"info2" : "no configuration explicitly specified -- making one",
"ok" : 0,
"errmsg" : "couldn't initiate : can't find self in the replset config"
}


Jeremias Brödel

unread,
Jun 11, 2014, 12:11:19 PM6/11/14
to mongod...@googlegroups.com, blond...@gmail.com

Hello Daniel,
It's likely that that hostname is not in /etc/hosts on the machine.

Fix the configuration in /etc/hosts


Regards,
Jeremias



--
Jeremias Broedel
Linux Consultant

Mail: bro...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

Daniel Blondowski

unread,
Jun 11, 2014, 2:10:30 PM6/11/14
to mongod...@googlegroups.com
Yes, I checked it. It's there.

10.1.114.151 mongo1.prod.xxx.com mongo1

Daniel Blondowski

unread,
Jun 11, 2014, 2:24:55 PM6/11/14
to mongod...@googlegroups.com
I do see this on mongod.log

2014-06-11T13:22:58.412-0500 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, replicati
on: { replSet: "diceprodrs1" }, storage: { dbPath: "/var/lib/mongo" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }

It's using 127.0.0.1 not the actual IP

On Wednesday, June 11, 2014 10:37:42 AM UTC-5, Daniel Blondowski wrote:

Daniel Blondowski

unread,
Jun 11, 2014, 2:45:59 PM6/11/14
to mongod...@googlegroups.com
Could this be a problem?
MongoDB shell version: 2.6.1
2014-06-11T13:44:28.578-0500 warning: Failed to connect to 10.1.114.151:27017, reason: errno:111 Connection refused
2014-06-11T13:44:28.580-0500 Error: couldn't connect to server mongo1.xxx.dice.com:27017 (10.1.114.151), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed

But this works.
# mongo mongo1 
MongoDB shell version: 2.6.1
connecting to: mongo1

Daniel Blondowski

unread,
Jun 11, 2014, 2:57:39 PM6/11/14
to mongod...@googlegroups.com
Figured it out.

This was set in mongodb.conf: bind_ip=127.0.0.1
Once I commented it out it worked.


On Wednesday, June 11, 2014 10:37:42 AM UTC-5, Daniel Blondowski wrote:

Asya Kamsky

unread,
Jun 15, 2014, 4:47:54 AM6/15/14
to mongod...@googlegroups.com
Glad you resolved this.   This is sort of security related as you should be controlling which interfaces mongod listens on and localhost is the only safe default to ship it with...

Asya
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/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 http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/6ede7979-86ee-4e8c-9f47-434b4909b6f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages