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

MongoDB replication does not work with authentication.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.2.7
    • Replication
    • None
    • ALL
    • Hide

      Start mongod instance:

      mongod --dbpath d:\data

      From mong client create user:

      db.addUser("u","p")
      db.auth("u","p")

      Stop the server and restart it with following options

      mongod --dbpath d:\data --auth --replSet "rs0"

      Execute following from mongo client with/without authentication

      rs.initiate()

      Show
      Start mongod instance: mongod --dbpath d:\data From mong client create user: db.addUser("u","p") db.auth("u","p") Stop the server and restart it with following options mongod --dbpath d:\data --auth --replSet "rs0" Execute following from mongo client with/without authentication rs.initiate()

    Description

      We have standalone MongoDB server which has authentication service enabled. We want to query oplog.rs collection to implement certain feature. When we try to enable replication we get following error.

      (code)
      > rs.initiate()
      {
      "info2" : "no configuration explicitly specified – making one",
      "me" : "EDemo:37017",
      "errmsg" : "couldn't initiate : can't find self in the replset config my port: 37017",
      "ok" : 0
      }

      > db.isMaster()
      {
      "ismaster" : false,
      "secondary" : false,
      "info" : "can't get local.system.replset config from self or any seed (EMPTYCONFIG)",
      "isreplicaset" : true,
      "maxBsonObjectSize" : 16777216,
      "localTime" : ISODate("2014-08-13T10:50:40.321Z"),
      "ok" : 1
      }

      On server following error is observed:

      invalid parameter: expected an object ()
      [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
      (code)

      If we disable authentication then replication works fine. please suggest.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vsugur Vinod Sugur
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: