Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1519

rs.initiate() generates bad config: all host _id's are 0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.5.6
    • Fix Version/s: 1.5.8
    • Component/s: Replication
    • Labels:
      None
    • Environment:
      db version v1.5.7-pre-, pdfile version 4.5
      git version: db8bd901d8be3eaeabc3a25646c3deb56e523d6d
    • Operating System:
      ALL

      Description

      1. Start two replica set servers that have not been initiated yet
      server1> ./mongod --replSet yo/<host>:27018
      server2> ./mongod --dbpath /data/db2 --port 27018 --replSet yo/<host>:27017

      2. Start mongo shell connecting to one of them
      client> ./mongo <host>/test

      3. Initiate replica set using default config
      client> rs.initiate()
      {
      "info2" : "no configuration explicitly specified – making one",
      "assertion" : "can't find self in the replset config",
      "assertionCode" : 13279,
      "errmsg" : "db assertion failure",
      "ok" : 0
      }

      In server1 log below, notice that generated configuration has _id 0 for both hosts. That is the problem. It works when you supply the config explicitly with unique host _ids.

      Fri Jul 30 12:12:34 [conn3] replSet replSetInitiate admin command received from client
      Fri Jul 30 12:12:34 [conn3] replSet info initiate : no configuration specified. Using a default configuration for the set
      Fri Jul 30 12:12:34 [conn3] replSet created this configuration for initiation : { _id: "yo", members: [

      { _id: 0, host: "<host>:27017" }

      ,

      { _id: 0, host: "<host>:27018" }

      ] }
      Fri Jul 30 12:12:34 [conn3] replSet replSetInitiate config object parses ok, 1 members specified
      Fri Jul 30 12:12:34 [conn3] replSet replSetInitiate exception: can't find self in the replset config
      Fri Jul 30 12:12:36 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
      Fri Jul 30 12:12:36 [startReplSets] replSet have you ran replSetInitiate yet?
      Fri Jul 30 12:12:36 [startReplSets] replSet sleeping 20sec and will try again.

        Attachments

          Activity

            People

            Assignee:
            dwight_10gen Dwight Merriman
            Reporter:
            tonyh Tony Hannan
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: