Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run MongoDB on an Amazon EC2 off the local drive and default folder and move all data files, log files, on mounted raid5 ebs drive. I have already tried both methods:

1- edit the /etc/mongodb.conf file to my new location 2- symlink the data folder

in both way mongodb still save their file in default path and nothing happen!!! What exactly should I do?!!! I install mongodb through couple of script as follow (with root account):

1-Install Directory:

ln -s /var/lib/mongodb $1/data
ln -s /var/log/mongodb $1/log

2- Setup Config file:

echo "dbpath=/var/lib/mongodb" >> /etc/mongodb.conf
echo "logpath=/var/log/mongodb/mongod.log" >> /etc/mongodb.conf
echo "logappend=true" >> /etc/mongodb.conf
echo "replSet=myrepl" >> /etc/mongodb.conf
echo "smallfiles=$SMALLFILES" >> /etc/mongodb.conf

3- Install Mongo:

apt-key adv --keyserver --recv 7F0CEB10
echo 'deb dist 10gen' >> /etc/apt/sources.list.d/10gen.list
apt-get update
apt-get install mongodb-10gen=2.4.3
echo "mongodb-10gen hold" | dpkg --set-selections
share|improve this question
See if anything in here helps… – Timothy Makobu Jul 27 '13 at 22:07

Firstly, a note: do not use RAID 5, it's generally going to perform poorly (use RAID 10). It's also recommended in the AWS whitepaper.

Generally, you should post what your filesystem actually looks like now, what the contents of the config file are after the install, not the path you take to create them. What if your sym links are failing? What if the files already exist? etc.

You also don't mention how you copied the files from the ephemeral disk to EBS. Did that succeed? If so, then that is what should be entered into the mongod.conf file for dbpath

Basically, it's unclear what your problem is because you have not actually described it very well. If you clean up the question I will be happy to give more specific and explicit advice.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.