[mongodb-user] MongoDB on Ubuntu 9.10 - Start up by Default?

49 views
Skip to first unread message

EricM

unread,
Apr 25, 2010, 1:11:54 PM4/25/10
to mongodb-user
Hey Guys,

I am currently running Mongo in Windows, but would like to transition
it to Linux, Ubuntu preferrably. I am not very advanced with Linux, I
am pretty comfortable with the command line and everything just not
very familiar with everything else. Anyways I want MongoDB to startup
by default in case the server gets rebooted or whatever and for it to
do any maintenance it needs if this happens such as repair commands.
How do I do this? Is there a file in Linux I can edit that is like a
startup file so I can put commands in it?

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

Лоик

unread,
Apr 25, 2010, 1:53:34 PM4/25/10
to mongod...@googlegroups.com
You should create a init file. Not sure if the deb packages provide one.

then you can set mongo to start on boot like any init.rc script. (/etc/init.d) symlink in /etc/init.x/...

Richard Kreuter

unread,
Apr 25, 2010, 2:40:36 PM4/25/10
to mongod...@googlegroups.com
The packages 10gen publishes for Ubuntu 9.10 contain an upstart script
(at /etc/init/mongodb.conf) that starts mongod by default when the
system boots (or, if it doesn't, that's a bug; please let us know).

--
Richard

EricM

unread,
Apr 25, 2010, 3:05:22 PM4/25/10
to mongodb-user
Richard,

I followed the QuickStart guide, I didn't realize there was a package
in the repository?

On Apr 25, 2:40 pm, Richard Kreuter <rich...@10gen.com> wrote:
> The packages 10gen publishes for Ubuntu 9.10 contain an upstart script
> (at /etc/init/mongodb.conf) that starts mongod by default when the
> system boots (or, if it doesn't, that's a bug; please let us know).
>
> --
> Richard
>

EricM

unread,
Apr 25, 2010, 3:13:54 PM4/25/10
to mongodb-user
Alright, trying this all over from scratch with the packages this time
following instructions on the Ubuntu page that I somehow did not
see...Will keep you apprised...

EricM

unread,
Apr 25, 2010, 8:46:18 PM4/25/10
to mongodb-user
Ok so I got this to work but it was problematic, first off upstart is
not installed by default so typing: sudo apt-get install upstart
should be added to the documentation for Ubuntu Server editions.
Secondly there is no user mongodb, I had to create this user so the
adduser command should also be added to the documentation. I also had
to run a chmod -R on the log and lib directories...

Works now though...

Richard Kreuter

unread,
Apr 26, 2010, 10:01:44 AM4/26/10
to mongod...@googlegroups.com
EricM <eric.ma...@gmail.com> wrote:

> I followed the QuickStart guide, I didn't realize there was a package
> in the repository?

There is an mongodb package in Ubuntu's repository for 10.04 (Lucid),
but not for 9.10.

However, we (10gen) publish mongodb packages for the last several Ubuntu
releases. See this page for details:

http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages

Regards,
Richard

deinerson1

unread,
Apr 26, 2010, 11:22:52 AM4/26/10
to mongodb-user
I am running mongodb-stable from the repositories for Ubuntu 9.10 (64-
bit) with no troubles at all. It has even updated a few times recently
with no problems. It starts automatically and is ready every time. See
below regarding the the PHP driver, which did have a few more steps to
it.
I followed the instructions in the link:
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages

I added the suggested line: deb http://downloads.mongodb.org/distros/ubuntu
9.10 10gen using the GUI Administration --> Software Sources --> Other
Software tab --> Add... button
then created a txt file containing the copied and pasted PGP repo key
and manually added that via the Authentication tab using the Import
button.

The (PHP) driver was a little more involved. I had to install: apt-get
install php5-dev to install phpize, which is used by the following
instructions:

Installing on *NIX from http://www.php.net/manual/en/mongo.installation.php

Run:

$ sudo pecl install mongo

Add the following line to your php.ini file (be sure to use php_info()
to find the correct one to mod):

extension=mongo.so


Since then it has been working splendidly.

On Apr 26, 8:01 am, Richard Kreuter <rich...@10gen.com> wrote:

Richard Kreuter

unread,
Apr 26, 2010, 11:29:15 AM4/26/10
to mongod...@googlegroups.com
Hrm. I just installed a fresh Ubuntu 9.10 server image; it came with
upstart, and the mongodb-stable package installed and started cleanly.
So I'm sorry to say I can't tell how to reproduce the troubles you're
having.

Please let us know if you have further troubles with the packages.

--
Richard

EricM writes:
> Ok so I got this to work but it was problematic, first off upstart is
> not installed by default so typing: sudo apt-get install upstart
> should be added to the documentation for Ubuntu Server editions.
> Secondly there is no user mongodb, I had to create this user so the
> adduser command should also be added to the documentation. I also had
> to run a chmod -R on the log and lib directories...
>
> Works now though...
>
>
>
> On Apr 25, 3:13=C2=A0pm, EricM <eric.malamis...@gmail.com> wrote:
> > Alright, trying this all over from scratch with the packages this time
> > following instructions on the Ubuntu page that I somehow did not
> > see...Will keep you apprised...
> >
> > On Apr 25, 3:05=C2=A0pm, EricM <eric.malamis...@gmail.com> wrote:
> >
> >
> >
> >
> >
> > > Richard,
> >
> > > I followed the QuickStart guide, I didn't realize there was a package
> > > in the repository?
> >
> > > On Apr 25, 2:40=C2=A0pm, Richard Kreuter <rich...@10gen.com> wrote:
> >
> > > > The packages 10gen publishes for Ubuntu 9.10 contain an upstart scrip=
> t
> > > > (at /etc/init/mongodb.conf) that starts mongod by default when the
> > > > system boots (or, if it doesn't, that's a bug; please let us know).
> >
> > > > --
> > > > Richard
> >
> > > > =D0=9B=D0=BE=D0=B8=D0=BA <lamers...@gmail.com> wrote:
> > > > > You should create a init file. Not sure if the deb packages provide=
> one.
> >
> > > > > then you can set mongo to start on boot like any init.rc script. (/=
> etc/init.d)
> > > > > symlink in /etc/init.x/...
> >
> > > > --
> > > > You received this message because you are subscribed to the Google Gr=
> oups "mongodb-user" group.
> > > > To post to this group, send email to mongod...@googlegroups.com.
> > > > To unsubscribe from this group, send email to mongodb-user+unsubscrib=
> e...@googlegroups.com.
> > > > For more options, visit this group athttp://groups.google.com/group/m=
> ongodb-user?hl=3Den.
> >
> > > --
> > > You received this message because you are subscribed to the Google Grou=
> ps "mongodb-user" group.
> > > To post to this group, send email to mongod...@googlegroups.com.
> > > To unsubscribe from this group, send email to mongodb-user+unsubscribe@=
> googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/mon=
> godb-user?hl=3Den.
> >
> > --
> > 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+unsubscribe@go=
> oglegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/mongo=
> db-user?hl=3Den.
>
> --=20
> 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+unsubscribe@goog=
> legroups.com.
> For more options, visit this group at http://groups.google.com/group/mongod=
> b-user?hl=3Den.

Tim Nelson

unread,
Apr 26, 2010, 11:40:01 AM4/26/10
to mongod...@googlegroups.com
On Sun, Apr 25, 2010 at 7:46 PM, EricM <eric.ma...@gmail.com> wrote:
> Ok so I got this to work but it was problematic, first off upstart is
> not installed by default so typing: sudo apt-get install upstart
> should be added to the documentation for Ubuntu Server editions.


FYI, as of 9.10 Ubuntu is actually transitioning everything to Upstart
[1] from the SysV init system. So, it seems rather odd that you had to
manually install Upstart. Are you sure you're using 9.10?

Tim

[1] http://www.ubuntu.com/testing/karmic/beta

EricM

unread,
Apr 26, 2010, 2:00:08 PM4/26/10
to mongodb-user
Hi Tim,

I am positive I did it three times, I just re-downloaded the ISO to be
sure...The only difference which it might matter is I am letting
VMWare do its automated installation procedures instead of me walking
through the install myself. Do you think that matters? Maybe VMWare
selects a different package or something?

Eric

On Apr 26, 11:40 am, Tim Nelson <tnell...@gmail.com> wrote:
> On Sun, Apr 25, 2010 at 7:46 PM, EricM <eric.malamis...@gmail.com> wrote:
> > Ok so I got this to work but it was problematic, first off upstart is
> > not installed by default so typing: sudo apt-get install upstart
> > should be added to the documentation for Ubuntu Server editions.
>
> FYI, as of 9.10 Ubuntu is actually transitioning everything to Upstart
> [1] from the SysV init system. So, it seems rather odd that you had to
> manually install Upstart. Are you sure you're using 9.10?
>
> Tim
>
> [1]http://www.ubuntu.com/testing/karmic/beta
>
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.To post to this group, send email tomongo...@googlegroups.com.To unsubscribe from this group, send email tomongodb-use...@googlegroups.com.

Tim Nelson

unread,
Apr 26, 2010, 2:46:51 PM4/26/10
to mongod...@googlegroups.com
Sorry, I've never used VMWare. I use VirtualBox for virtualization,
but I haven't tried installing MongoDB in a VB machine either.

Tim
Reply all
Reply to author
Forward
0 new messages