trouble setting up replica set

102 views
Skip to first unread message

Zac Witte

unread,
Sep 6, 2010, 9:02:10 PM9/6/10
to mongodb-user
I have a DB that is currently single-server and I'm trying to move it to a replica set. Currently everything is on app.checkin.to and I want to add s1db1.checkin.to and s1db2.checkin.to. All servers are running 1.6.2 and the two new server are blank. The --replSet parameter is checkinto.

From app.checkin.to I do:
config = {
        "_id" : "checkinto",
        "members" : [
                {
                        "_id" : 0,
                        "host" : "app.checkin.to"
                },
                {
                        "_id" : 1,
                        "host" : "s1db1.checkin.to"
                },
                {
                        "_id" : 2,
                        "host" : "s1db2.checkin.to"
                }
        ]
}
> rs.initiate(config);
{
        "info" : "Config now saved locally.  Should come online in about a minute.",
        "ok" : 1
}
> rs.status()
{
        "set" : "checkinto",
        "date" : "Mon Sep 06 2010 17:50:09 GMT-0700 (PDT)",
        "myState" : 5,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "fs:27017",
                        "health" : 1,
                        "state" : 5,
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "s1db1.checkin.to",
                        "health" : 0,
                        "state" : 6,
                        "uptime" : 0,
                        "lastHeartbeat" : "Mon Sep 06 2010 17:50:07 GMT-0700 (PDT)",
                        "errmsg" : "still initializing"
                },
                {
                        "_id" : 2,
                        "name" : "s1db2.checkin.to",
                        "health" : 0,
                        "state" : 6,
                        "uptime" : 0,
                        "lastHeartbeat" : "Mon Sep 06 2010 17:50:07 GMT-0700 (PDT)",
                        "errmsg" : "still initializing"
                }
        ],
        "ok" : 1
}
> db.isMaster()
{
        "setName" : "checkinto",
        "ismaster" : false,
        "secondary" : false,
        "hosts" : [
                "app.checkin.to",
                "s1db2.checkin.to",
                "s1db1.checkin.to"
        ],
        "ok" : 1
}


Server logs:

Mon Sep  6 17:48:22 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Mon Sep  6 17:48:32 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Mon Sep  6 17:48:42 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Mon Sep  6 17:48:52 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Mon Sep  6 17:48:55 [initandlisten] connection accepted from 127.0.0.1:54158 #3
Mon Sep  6 17:49:01 [conn3] replSet replSetInitiate admin command received from client
Mon Sep  6 17:49:01 [conn3] replSet replSetInitiate config object parses ok, 3 members specified
Mon Sep  6 17:49:01 [initandlisten] connection accepted from 204.14.159.227:40043 #4
Mon Sep  6 17:49:01 [conn3] replSet replSetInitiate all members seem up
Mon Sep  6 17:49:01 [conn3] replSet info saving a newer config version to local.system.replset
Mon Sep  6 17:49:01 [conn3] replSet replSetInitiate config now saved locally.  Should come online in about a minute.
Mon Sep  6 17:49:01 [conn3] query admin.$cmd ntoreturn:1 command: { replSetInitiate: { _id: "checkinto", members: [ { _id: 0.0, host: "app.checkin.to" }, { _id: 1.0, host: "s1db1.checkin.to" }, { _id: 2.0, host: "s1db2.checkin.to" } ] } } reslen:128 687ms
Mon Sep  6 17:49:02 [rs Manager] replSet can't see a majority, will not try to elect self
Mon Sep  6 17:49:08 [initandlisten] connection accepted from 184.72.221.82:41369 #5
Mon Sep  6 17:49:11 [initandlisten] connection accepted from 184.72.221.81:54729 #6


s1db1:
...
Tue Sep  7 00:47:31 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:47:41 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:47:51 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:48:01 [initandlisten] connection accepted from 204.14.159.227:42307 #2
Tue Sep  7 00:48:01 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:48:11 [startReplSets] replSet warning can't find self in the repl set configuration:
Tue Sep  7 00:48:11 [startReplSets] { _id: "checkinto", version: 1, members: [ { _id: 0, host: "app.checkin.to" }, { _id: 1, host: "s1db1.checkin.to" }, { _id: 2, host: "s1db2.checkin.to" } ] }
Tue Sep  7 00:48:11 [startReplSets] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
Tue Sep  7 00:48:32 [startReplSets] replSet warning can't find self in the repl set configuration:
Tue Sep  7 00:48:32 [startReplSets] { _id: "checkinto", version: 1, members: [ { _id: 0, host: "app.checkin.to" }, { _id: 1, host: "s1db1.checkin.to" }, { _id: 2, host: "s1db2.checkin.to" } ] }
Tue Sep  7 00:48:32 [startReplSets] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
Tue Sep  7 00:48:52 [startReplSets] replSet warning can't find self in the repl set configuration:
Tue Sep  7 00:48:52 [startReplSets] { _id: "checkinto", version: 1, members: [ { _id: 0, host: "app.checkin.to" }, { _id: 1, host: "s1db1.checkin.to" }, { _id: 2, host: "s1db2.checkin.to" } ] }
Tue Sep  7 00:48:52 [startReplSets] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
... (continuing infinitely)

s1db2:
...
Tue Sep  7 00:47:28 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:47:38 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:47:48 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:47:58 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Tue Sep  7 00:48:01 [initandlisten] connection accepted from 204.14.159.227:37455 #2
Tue Sep  7 00:48:09 [startReplSets] replSet warning can't find self in the repl set configuration:
Tue Sep  7 00:48:09 [startReplSets] { _id: "checkinto", version: 1, members: [ { _id: 0, host: "app.checkin.to" }, { _id: 1, host: "s1db1.checkin.to" }, { _id: 2, host: "s1db2.checkin.to" } ] }
Tue Sep  7 00:48:09 [startReplSets] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
Tue Sep  7 00:48:29 [startReplSets] replSet warning can't find self in the repl set configuration:
Tue Sep  7 00:48:29 [startReplSets] { _id: "checkinto", version: 1, members: [ { _id: 0, host: "app.checkin.to" }, { _id: 1, host: "s1db1.checkin.to" }, { _id: 2, host: "s1db2.checkin.to" } ] }
Tue Sep  7 00:48:29 [startReplSets] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
Tue Sep  7 00:48:49 [startReplSets] replSet warning can't find self in the repl set configuration:
Tue Sep  7 00:48:49 [startReplSets] { _id: "checkinto", version: 1, members: [ { _id: 0, host: "app.checkin.to" }, { _id: 1, host: "s1db1.checkin.to" }, { _id: 2, host: "s1db2.checkin.to" } ] }
Tue Sep  7 00:48:49 [startReplSets] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
... (continuing infinitely)

Kyle Banker

unread,
Sep 6, 2010, 9:36:02 PM9/6/10
to mongod...@googlegroups.com
It seems like the operative error is that s1db1 and s1db2 can't find themselves in the config.

replSet warning can't find self in the repl set configuration

Are those machines using the default port? Do their hostnames match the names you've provided?





--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Zac Witte

unread,
Sep 6, 2010, 10:20:51 PM9/6/10
to mongodb-user
Ah, yes the hostnames were the issue.

Thanks.
> > mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google groups.com>
> > .
Reply all
Reply to author
Forward
0 new messages