[SERVER-1461] master -> slave replication with auth db._adminCommand({serverStatus:1,repl:2}); returns MasterFirst/Last jan 1 1970 and huge lag sec Created: 22/Jul/10  Updated: 12/Jul/16  Resolved: 16/Aug/10

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 1.4.4
Fix Version/s: 1.7.0

Type: Bug Priority: Major - P3
Reporter: Byron Albert Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

cent os 5.3
> db.serverBuildInfo()
{
"version" : "1.4.4",
"gitVersion" : "9dcac11bd72c7cb34ca278313f033efcdd4908eb",
"sysInfo" : "Linux domU-12-31-39-06-79-A1 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41",
"bits" : 64,
"ok" : 1
}
>


Attachments: File mongo-logs.tgz    
Operating System: Linux
Participants:

 Description   

When I setup replication between a master and slave where they are both using auth and run
db._adminCommand(

{serverStatus:1,repl:2}

);
in the output i get the following

"repl" : {
"ismaster" : 0,
"msg" : "not paired",
"sources" : [
{
"host" : "10.10.0.1",
"syncedTo" :

{ "time" : "Thu Jul 22 2010 15:07:37 GMT+0000 (UTC)", "inc" : 4717 }

,
"masterFirst" : "Thu Jan 01 1970 12:16:47 GMT+0000 (UTC)",
"masterLast" : "Thu Jan 01 1970 12:16:47 GMT+0000 (UTC)",
"lagSeconds" : 18446742793942500
}
]
},

To create the issue i start by setting up a master with the following config

  1. cat /etc/mongod.conf
    dbpath = /db/mongodb
    logpath = /db/logs/mongodb.log
    fork = true
    bind_ip = 0.0.0.0
    master = true
    directoryperdb = true
    syncdelay = 5
    oplogSize = 51200
    auth = true

then log into the admin database locally create an admin user, then auth and switch to the local database and create the repl user.

Then start a slave with the following config

  1. cat /etc/mongod.conf
    dbpath = /db/mongodb
    logpath = /db/logs/mongodb.log
    fork = true
    bind_ip = 0.0.0.0
    slave = true
    source = 10.10.0.1
    directoryperdb = true
    syncdelay = 5
    auth = true

Login and create the local repl user.

Import some data on the master

then run
> db._adminCommand(

{serverStatus:1,repl:2}

);
and get the output above

Logs are attached



 Comments   
Comment by auto [ 16/Aug/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-1461 auth when getting remote authlog info
http://github.com/mongodb/mongo/commit/5cfa013077c4a4d4f59dbbff6ec00f8bf6024713

Generated at Thu Feb 08 02:57:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.