Tag Info

Hot answers tagged

22

The MongoDB daemon (mongod) has a command-line option to run the server in the background... --fork This command-line option requires that you also specify a file to log messages to (since it can not use the current console). An example of this command looks like: mongod --fork --logpath /var/log/mongod.log You could put this into an /etc/init.d/mongod ...


19

mutt, an email client, uses file access times to monitor for new mail arriving on an mbox-formatted mailbox. Apparently, this problem is not serious, and is easy to work around. Other than that, it is difficult to find examples of things that break on noatime. I run a number of Linux servers with noatime on all filesystems, and I can't recall ever having ...


13

check if there's any mongo.lock file in /var/lib/mongo/ dir or your MONGOLIBDIR setting and remove it. You should then be able to start the mongodb service.


13

Yes, you can do this by specifying different port numbers and data directories for the other instances of mongod, and then specifying the new port number in the client. For example: ./mongod --dbpath /foo/bar/otherpath --port some_other_port You can also change the shard server and config server port numbers if you need to.


13

If you are at a point where the current performance is too slow or the limits are reached then you have three options. And they are true for any problem. Scale vertically: Meaning increase your machine power. More CPU or more RAM. Scale horizontally: Meaning increase the amount of workers. More processes, more threads, more machines. Change design: Do it ...


12

This is intended as an addendum to the other answers posted here, which discus many of the relevant elements to be considered here. However, there is another, often overlooked, factor when it comes to efficient RAM utilization in a random access type system - readahead. You can check the current settings for readahead (on Linux) by running blockdev ...


11

Security and Authentication MongoDB documentation.


11

Whenever possible, use packages shipped with the distribution. This makes management a lot easier.


11

My guess would be either: pecl install mongo is actually installing a pre-built binary (which would be really dumb, but wouldn't be nearly as surprising); or You've still got the old php5-dev package from your 5.3 installation sitting around, and pecl is finding and using that instead of the 5.4 version. Take a look at your PHP-related packages list (dpkg ...


11

You can actually run a single member "set" if you want. 3 members (or a higher odd number) is really best, though. Replica sets go read only if a majority of the set isn't available, so if you lose a member in a two-member set the remaining member becomes read only. You can run two full members plus an "voting-only" member (called an arbiter) as well. This ...


10

It is very important to use a 64 bit machine not 32 bit. http://blog.mongodb.org/post/137788967/32-bit-limitations


9

Tools that poll for file usage such as temporary file cleaners use it. You can get around this on some filesystems and OSes by using relatime instead, which only updates the atime after a certain duration has passed since it was last updated.


9

As with most database systems, the database files does not shrink when you delete data, the data is just removed/marked as deleted, and the space is reused. You'll need to run db.repairDatabase() to compact space as noted here


9

We posted this same question on the Mongo forum, and the Mongo CTO responded, saying to review his presentation on how to optimize indexes http://www.10gen.com/presentations/mongosf2011/schemascale In this presentation, Mr. Horowitz states explicitly that sharding/horiz scaling can be overkill in many situations, and that design approaches (including some ...


9

The main difference that you'll see between the Ubuntu repository and the MongoDB project's own repository is their definition of "stable". The Ubuntu repository will keep the same major version of MongoDB in their repository that was initially tested with the version of Ubuntu that you're running. Any security updates or major bugfixes released in a new ...


9

First of all, please READ the blessed documentation you linked to: mongod.lock Do not remove the mongod.lock file. If mongod is unable to start, use one of the methods above to correct the situation. Removing the lock file will allow the database to start when its data may be corrupt. In general, you should never force the database to start ...


8

Duplicate .. htop is showing different threads as well. not just processes. top and ps show only processes.


8

All the mongod.lock file is telling you is that the DB had an unclean shutdown, i.e. was not stopped by an admin, etc. When running a --repair operation by itself, mongod will attempt to read the existing files, write new files and then swap them. Once complete, it should remove the mongod.lock file, and enable you to startup the database. If used in ...


8

Building on this document, first we need to decide what our identifying trait is, so that the filter is successful and only picks out the heartbeats. Then, we need to get the hex representation of that identifier. Starting with the outbound heartbeat itself (which is essentially just a query/command), it is an admin command and contains the following ...


7

With MongoDB what you want is RAM. And then some more RAM. Buying RAM can't hurt.


7

You could also create a seperate mount point for your mongoDB replica set. You can then set the noatime paramtere on that mountpoint only without affecting any other programs.


7

the space will not show up until all processes release the file. Try using lsof to see what's using the file.


7

MongoDB performs best if the entire database can fit in memory - so a high memory instance may be a consideration, especially if your application is read-heavy (good indexes will also help). MongoDB uses memory mapped files - so it is fairly efficient about what it stores in memory and what it writes to disk. Indexes are prioritized, and should always be ...


7

As you see in your output of free, 47460076 byte are cached. They are freed if needed. Don't worry you have plenty of memory and mongoDB won't eat it. It just takes a bit of ram that is immediately freed when other applications really need it.


7

After few days of intense trial and errors, I'm glad to be able to say that I've understood where the bottleneck was, and I'll post it here so that other people can benefit from my findings. The problem lies in the pub/sub connections that I was using with socket.io, and in particular in the RedisStore used by socket.io to handle inter-process ...


7

Check the file /etc/security/limits.d/90-nproc.conf as this is likely overriding your settings. I wrote about this exact same issue last year http://scott.cm/max-processes-1024-limits-conf/


6

ReplicaSet will work in this scenario. However, I cannot tell if having two MongoDB instances at the same server is a good idea -- this depends on the server hardware/software and load. To make sure your backup MongoDB node does not become master, set its priority parameter to 0, e.g. rs.add({_id: 1, host: "localhost:<port>", priority: 0}) NOTE: if ...


6

you can send it a termination signal per the document from any unix. you can use ps to find the PID of the mongoDB. see the following: Sending a Unix INT or TERM signal You can cleanly stop mongod using a SIGINT or SIGTERM signal on Unix-like systems. Either ^C, "kill -2 PID," or kill -15 PID will work. Sending a KILL signal kill -9 will probably ...



Only top voted, non community-wiki answers of a minimum length are eligible