server Repair option strangeness

21 views
Skip to first unread message

Tim Hawkins

unread,
Jun 13, 2010, 4:26:26 AM6/13/10
to mongod...@googlegroups.com
Using 1.4.3. 

I was testing the repair option on what was essential an empty database that had been created using an older version of mongoDB. 

stopped my server

ran 

$sudo mongod -f /etc/mongodb.conf --repair

Sun Jun 13 14:18:45 Mongo DB : starting : pid = 3697 port = 27017 dbpath = /var/lib/mongodb master = 0 slave = 0  64-bit

Sun Jun 13 14:18:45 ****

Sun Jun 13 14:18:45 ****

Sun Jun 13 14:18:45 need to upgrade database admin with pdfile version 4.5, new version: 4.5

Sun Jun 13 14:18:45                    starting upgrade

Sun Jun 13 14:18:45  admin repairDatabase admin

Sun Jun 13 14:18:45 allocating new datafile /var/lib/mongodb/$tmp_repairDatabase_0/admin.ns, filling with zeroes...

Sun Jun 13 14:18:45 done allocating datafile /var/lib/mongodb/$tmp_repairDatabase_0/admin.ns, size: 16MB, took 0.006 secs

Sun Jun 13 14:18:45 allocating new datafile /var/lib/mongodb/$tmp_repairDatabase_0/admin.0, filling with zeroes...

Sun Jun 13 14:18:45 done allocating datafile /var/lib/mongodb/$tmp_repairDatabase_0/admin.0, size: 64MB, took 0.026 secs

Sun Jun 13 14:18:45 allocating new datafile /var/lib/mongodb/$tmp_repairDatabase_0/admin.1, filling with zeroes...

Sun Jun 13 14:18:45 building new index on { _id: 1 } for admin.system.users

Sun Jun 13 14:18:45 Buildindex admin.system.users idxNo:0 { name: "_id_", ns: "admin.system.users", key: { _id: 1 } }

Sun Jun 13 14:18:45 done for 0 records 0secs

Sun Jun 13 14:18:45 done allocating datafile /var/lib/mongodb/$tmp_repairDatabase_0/admin.1, size: 128MB, took 0.052 secs

Sun Jun 13 14:18:45 finished checking dbs

Sun Jun 13 14:18:45  dbexit:

Sun Jun 13 14:18:45                    shutdown: going to close listening sockets...

Sun Jun 13 14:18:45                    shutdown: going to flush oplog...

Sun Jun 13 14:18:45                    shutdown: going to close sockets...

Sun Jun 13 14:18:45                    shutdown: waiting for fs preallocator...

Sun Jun 13 14:18:45                    shutdown: closing all files...

Sun Jun 13 14:18:45      closeAllFiles() finished

Sun Jun 13 14:18:45                    shutdown: removing fs lock...

Sun Jun 13 14:18:45  dbexit: really exiting now

 all looked good again

However when I started up the dbserver again, it would not start, complaining that the admin database files could not be found. 

On investigation i discovered that the admin files had been placed in /var/lib/mongodb/ and not in /var/lib/mongodb/admin 

moving them from the root to the ./admin directory solved the problem and the database server started up fine again. 

It looks like there is an inconsistent use of the --directoryperdb default option between mongod and mongod --repair 

I have checked the upstart files and its just using the /etc/mongodb.conf  which does not specify this option. 

Any Ideas? 

/etc/mongodb.conf 

# mongodb.conf

# Where to store the data.

# Note: if you run mongodb as a non-root user (recommended) you may
# need to create and set permissions for this directory manually,
# e.g., if the parent directory isn't mutable by the mongodb user.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongodb.log

logappend=true

#port = 27017



# Enables periodic logging of CPU utilization and I/O wait
#cpu = true

# Turn on/off security.  Off is currently the default
#noauth = true
#auth = true
rest =true 

# Verbose logging output.
#verbose = true

# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true

# Enable db quota management
#quota = true

# Set oplogging level where n is
#   0=off (default)
#   1=W
#   2=R
#   3=both
#   7=W+some reads
#oplog = 0

# Diagnostic/debugging option
#nocursors = true

# Ignore query hints
#nohints = true

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true

# Turns off server-side scripting.  This will result in greatly limited
# functionality
#noscripting = true

# Turns off table scans.  Any query that would do a table scan fails.
#notablescan = true

# Disable data file preallocation.
#noprealloc = true

# Specify .ns file size for new databases.
# nssize = <size>

# Accout token for Mongo monitoring server.
#mms-token = <token>

# Server name for Mongo monitoring server.
#mms-name = <server-name>

# Ping interval for Mongo monitoring server.
#mms-interval = <seconds>

# Replication Options

# in replicated mongo databases, specify here whether this is a slave or master
#slave = true
# Slave only: specify a single database to replicate
# or
#master = true

# Address of a server to pair with.
#pairwith = <server:port>
# Address of arbiter server.
#arbiter = <server:port>
# Automatically resync if slave data is stale
#autoresync
# Custom size for replication operation log.
#oplogSize = <MB>
# Size limit for in-memory storage of op ids.
#opIdMem = <bytes>



Dwight Merriman

unread,
Jun 13, 2010, 10:48:18 AM6/13/10
to mongod...@googlegroups.com
will look into it - probalby won't be able to drill down until tomorrow hope that is ok


--
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.

Tim Hawkins

unread,
Jun 13, 2010, 10:50:45 AM6/13/10
to mongod...@googlegroups.com
No problem, I was finger testing some documentation when I noticed this 

Eliot Horowitz

unread,
Jun 13, 2010, 11:40:55 PM6/13/10
to mongod...@googlegroups.com

aaron

unread,
Jun 22, 2010, 5:57:50 PM6/22/10
to mongodb-user
Hi Tim,

I'm just investigating this issue - I ran a test and directoryperdb
seems to work with repair in top of trunk.

I am curious about the situation you reported where sometimes mongod
is run in directoryperdb mode and sometimes it is not. That can
definitely cause problems. I wonder if you can provide more detail to
indicate how mongod is started with the directoryperdb option given
that it is not present in the provided mongodb.conf.

Thanks,
Aaron

On Jun 13, 8:40 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> Added case here:http://jira.mongodb.org/browse/SERVER-1231
>
>
>
> On Sun, Jun 13, 2010 at 10:50 AM, Tim Hawkins <tim.hawk...@me.com> wrote:
> > No problem, I was finger testing some documentation when I noticed this
>
> > On Jun 13, 2010, at 10:48 PM, Dwight Merriman wrote:
>
> > will look into it - probalby won't be able to drill down until tomorrow hope
> > that is ok
>
> > On Sun, Jun 13, 2010 at 4:26 AM, Tim Hawkins <tim.hawk...@me.com> wrote:
>
> >> Using 1.4.3.
> >> I was testing therepairoption on what was essential an empty database
Reply all
Reply to author
Forward
0 new messages