mongodb fails to start on CentOS 7

7,623 views
Skip to first unread message

Tim Dunphy

unread,
Oct 23, 2014, 8:32:11 PM10/23/14
to mongod...@googlegroups.com
Hey all,

 I just tried installing mongodb on a t2.micro instance that I grabbed off of the aws free tier. 


So, the command yum install mongodb-org seemed to go alright and everything did seem to successfully install.

But when I tried to start the daemon this is what I see:

[root@web1:/var/log] #service mongod restart
Restarting mongod (via systemctl):  Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.
                                                           [FAILED]

[root@web1:/var/log] #systemctl status mongod.service
mongod.service - SYSV: Mongo is a scalable, document-oriented database.
   Loaded: loaded (/etc/rc.d/init.d/mongod)
   Active: failed (Result: exit-code) since Thu 2014-10-23 20:23:53 EDT; 9s ago
  Process: 12243 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)

-- Logs begin at Sun 2014-08-24 22:45:04 EDT, end at Thu 2014-10-23 20:26:13 EDT. --
Oct 23 20:23:41 web1 systemd[1]: Unit mongod.service entered failed state.
Oct 23 20:23:53 web1 systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database....
-- Subject: Unit mongod.service has begun with start-up
-- Defined-By: systemd
--
-- Unit mongod.service has begun starting up.
Oct 23 20:23:53 web1 runuser[12248]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
Oct 23 20:23:53 web1 runuser[12248]: pam_unix(runuser:session): session closed for user mongod
Oct 23 20:23:53 web1 mongod[12243]: Starting mongod: [FAILED]
Oct 23 20:23:53 web1 systemd[1]: mongod.service: control process exited, code=exited status=1
Oct 23 20:23:53 web1 systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
--
-- Unit mongod.service has failed.


This is how much memory I have free:

[root@web1:/var/log] #free -m
             total       used       free     shared    buffers     cached
Mem:           992        381        611          1          0        167
-/+ buffers/cache:        213        779
Swap:         1023        410        613

So am I barking up the wrong tree in thinking that I can run my little mongodb test environment on a t2 micro instance? I hope not, because free is the best deal in town. And I really hope to learn rails development with mongodb.


Thanks
Tim



--
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Stephen Steneker

unread,
Oct 23, 2014, 9:07:48 PM10/23/14
to mongod...@googlegroups.com
On Friday, 24 October 2014 11:32:11 UTC+11, Tim Dunphy wrote:
 I just tried installing mongodb on a t2.micro instance that I grabbed off of the aws free tier. 

Hi Tim,

Although a t2.micro instance has very (very!) limited resource, I suspect the startup problem may be related to the Centos7 systemd init script rather than the instance size (eg: SERVER-14679).

I successfully stood up a t2.micro with 2.6.5 earlier this week using an Amazon Linux AMI to test that it worked (there was a similar question on twitter ;-). I'll try again with Centos7 and report back.


> So am I barking up the wrong tree in thinking that I can run my little mongodb test environment on a t2 micro instance?
> I hope not, because free is the best deal in town. And I really hope to learn rails development with mongodb.

If you're just looking for a hosted database for testing, several of the Database-as-a-Service providers offer free tiers or dev sandboxes. You might get more mileage running your dev application on the t2.micro connecting to a free hosted MongoDB instance.

If your current goal is mainly to learn Rails development with MongoDB, I think you'd have a much better experience installing a development environment on your own computer. There are packaged MongoDB installs available for Windows, OS X, and Linux (http://docs.mongodb.org/manual/installation/) as well as Rails installers (eg. http://railsinstaller.org/en).

If you don't want to "pollute" your own O/S environment, there are free options for virtualized environments as well.

Regards,
Stephen

Tim Dunphy

unread,
Oct 26, 2014, 10:50:30 AM10/26/14
to mongod...@googlegroups.com
Hey Stephen,

Thanks for the input! I prefer to keep my dev environment somewhere in the cloud. My only laptop is a work machine. So I don't feel comfy installing a lot of things on there that could interfere with my work. Free tier providers that offer hosted DB solutions may be one way to go. 

But for now I'm still trying to get this working on my t2.micro.

I tried running mongod on the command line 

[root@web1:~] #mongod
mongod --help for help and startup options
2014-10-26T10:39:01.603-0400 [initandlisten] MongoDB starting : pid=14052 port=27017 dbpath=/data/db 64-bit host=web1
2014-10-26T10:39:01.603-0400 [initandlisten] db version v2.6.5
2014-10-26T10:39:01.603-0400 [initandlisten] git version: e99d4fcb4279c0279796f237aa92fe3b64560bf6
2014-10-26T10:39:01.603-0400 [initandlisten] build info: Linux build8.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-10-26T10:39:01.603-0400 [initandlisten] allocator: tcmalloc
2014-10-26T10:39:01.603-0400 [initandlisten] options: {}
2014-10-26T10:39:01.605-0400 [initandlisten] journal dir=/data/db/journal
2014-10-26T10:39:01.606-0400 [initandlisten] recover : no journal files present, no recovery needed
2014-10-26T10:39:01.606-0400 [initandlisten]
2014-10-26T10:39:01.606-0400 [initandlisten] ERROR: Insufficient free space for journal files
2014-10-26T10:39:01.606-0400 [initandlisten] Please make at least 3379MB available in /data/db/journal or use --smallfiles
2014-10-26T10:39:01.606-0400 [initandlisten]
2014-10-26T10:39:01.606-0400 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2014-10-26T10:39:01.606-0400 [initandlisten] dbexit:
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: going to close listening sockets...
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: going to flush diaglog...
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: going to close sockets...
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: waiting for fs preallocator...
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: lock for final commit...
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: final commit...
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: closing all files...
2014-10-26T10:39:01.606-0400 [initandlisten] closeAllFiles() finished
2014-10-26T10:39:01.606-0400 [initandlisten] journalCleanup...
2014-10-26T10:39:01.606-0400 [initandlisten] removeJournalFiles
2014-10-26T10:39:01.606-0400 [initandlisten] shutdown: removing fs lock...
2014-10-26T10:39:01.606-0400 [initandlisten] dbexit: really exiting now

So using the --smallfiles option is what actually worked. 

[root@web1:~] #mongo
MongoDB shell version: 2.6.5
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
Questions? Try the support group


So I modified the init script like so:

OPTIONS=" -f $CONFIGFILE --smallfiles"

And now mongodb starts just fine on my rails development cloud instance!

[root@web1:~] #service mongod start
Starting mongod (via systemctl):  Warning: Unit file of mongod.service changed on disk, 'systemctl daemon-reload' recommended.
                                                           [  OK  ] 

Works just fine:

[root@web1:~] #mongo
MongoDB shell version: 2.6.5
connecting to: test

Thanks again for your input!

Tim

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/5dda12b4-0f5d-44a2-a35d-6165b0273151%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mohamd mohamadi

unread,
Aug 2, 2018, 6:05:52 PM8/2/18
to mongodb-user
hi

On version Cent.os 6 with 250mb ram can not run it i want run cezerin/git hub project on my website چربی گیر
Reply all
Reply to author
Forward
0 new messages