Morgodb EBS on EC2

I use mongodb and nodejs on ec2, I would like to deploy it to support 10,000 requests per day. I would like to make sure that if the instance is completed or rebooted (?), The database will not be lost. I understand that I need to create EBS volumes to store data.

I tried http://www.mongodb.org/display/DOCS/Amazon+EC2+Quickstart#AmazonEC2Quickstart-ConfigureStorage , but this did not work. I get to the point where I have to run [ec2-user @domU -... ~] $ sudo chown mongod: mongod / data but I get: chown: invalid user: `mongod: mongod '

solved this: sudo chown mongod.mongod / data still cannot work mongod:

$sudo /etc/init.d/mongod start Starting mongod: forked process: 1694 all output going to: /log/mongod.log [FAILED][ ec2-user@domU-... /]$ sudo mongod --dbpath=/data Mon Oct 29 21:46:56 [initandlisten] MongoDB starting : pid=1675 port=27017 dbpath=/data 64-bit host=domU-... Mon Oct 29 21:46:56 [initandlisten] db version v2.2.0, pdfile version 4.5 Mon Oct 29 21:46:56 [initandlisten] git version: f5e83eae9cfbec7fb7a071321928f00d1b0c5207 Mon Oct 29 21:46:56 [initandlisten] build info: Linux ... c8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49 Mon Oct 29 21:46:56 [initandlisten] options: { dbpath: "/data" } Mon Oct 29 21:47:00 [initandlisten] journal dir=/data/journal Mon Oct 29 21:47:00 [initandlisten] recover : no journal files present, no recovery needed Mon Oct 29 21:47:00 [initandlisten] Mon Oct 29 21:47:00 [initandlisten] ERROR: Insufficient free space for journal files Mon Oct 29 21:47:00 [initandlisten] Please make at least 3379MB available in /data/journal or use --smallfiles Mon Oct 29 21:47:00 [initandlisten] Mon Oct 29 21:47:00 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating Mon Oct 29 21:47:00 dbexit: Mon Oct 29 21:47:00 [initandlisten] shutdown: going to close listening sockets... Mon Oct 29 21:47:00 [initandlisten] shutdown: going to flush diaglog... Mon Oct 29 21:47:00 [initandlisten] shutdown: going to close sockets... Mon Oct 29 21:47:00 [initandlisten] shutdown: waiting for fs preallocator... Mon Oct 29 21:47:00 [initandlisten] shutdown: lock for final commit... Mon Oct 29 21:47:00 [initandlisten] shutdown: final commit... Mon Oct 29 21:47:00 [initandlisten] shutdown: closing all files... Mon Oct 29 21:47:00 [initandlisten] closeAllFiles() finished Mon Oct 29 21:47:00 [initandlisten] journalCleanup... Mon Oct 29 21:47:00 [initandlisten] removeJournalFiles Mon Oct 29 21:47:00 [initandlisten] shutdown: removing fs lock... Mon Oct 29 21:47:00 dbexit: really exiting now 

I DO NOT UNDERSTAND THE WORD IN MANUAL ... is it just me ...? Is there a simpler guide to achieve this? Thanks!

+4
source share
3 answers

The problem I encountered is described in: http://doubleclix.wordpress.com/2012/05/04/notes-on-mongo-at-aws/

Finally I followed the guide: http://d36cz9buwru1tt.cloudfront.net/AWS_NoSQL_MongoDB.pdf

And the mongo is running! I created only one EBS (20 GiB) in addition to the root volume ebs and mounted it in / data / db

I hope my deployment will work fine with nodejs and 10,000 client requests per day. (if I'm wrong, or if anyone has any deployment suggestions that I talked about, I would really appreciate it)

thanks

+3
source

Step

sudo yum -y install mongo-10gen-server

had to create a user to run mongodb. However, the 10Gen documentation contradicts whether this user is called mongod or mongo.

Try instead:

sudo chown mongo: mongo / data p>

This step changes the ownership of the / data directory for the mongo user and the mongo group.

+2
source

It may be easier to use a mongodb management solution like Scalegrid.io , which creates mongodb instances in your EC2 account. Getting an executable instance is actually an easier part of the job. You have to think about

  • Backup
  • Recovery
  • Monitoring
  • High availability in case your zone is down.
0
source

Source: https://habr.com/ru/post/1442768/


All Articles