Installing MongoDB 1.8.1 on Ubuntu 10.10 & 11.04 and running with an ‘init’ script.

Installing MongoDB 1.8.1, in my case as a developer database, is easy. This blog post just itemises all the steps so that you can pretty much blindly follow along. I’ll probably use these steps myself as I seem to be doing this regurlarly ;-)

Download the 64bit Linux binaries from here and unzip the contents to /usr/local.

cd /tmp
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.1.tgz
sudo tar -zxf /tmp/mongodb-linux-x86_64-1.8.1.tgz -C /usr/local

Setup some symbolic links.

sudo ln -s /usr/local/mongodb-linux-x86_64-1.8.1 /usr/local/mongodb
sudo ln -s /usr/local/mongodb/bin/bsondump /usr/local/bin/bsondump
sudo ln -s /usr/local/mongodb/bin/mongo /usr/local/bin/mongo
sudo ln -s /usr/local/mongodb/bin/mongod /usr/local/bin/mongod
sudo ln -s /usr/local/mongodb/bin/mongodump /usr/local/bin/mongodump
sudo ln -s /usr/local/mongodb/bin/mongoexport /usr/local/bin/mongoexport
sudo ln -s /usr/local/mongodb/bin/mongofiles /usr/local/bin/mongofiles
sudo ln -s /usr/local/mongodb/bin/mongoimport /usr/local/bin/mongoimport
sudo ln -s /usr/local/mongodb/bin/mongorestore /usr/local/bin/mongorestore
sudo ln -s /usr/local/mongodb/bin/mongos /usr/local/bin/mongos
sudo ln -s /usr/local/mongodb/bin/mongosniff /usr/local/bin/mongosniff
sudo ln -s /usr/local/mongodb/bin/mongostat /usr/local/bin/mongostat

The first “ln -s” above sets up a handy symbolic link between the versioned mongodb folder and its unversioned counterpart. When 10Gen release updates, say version 1.8.2, all you need to do is download, unzip, and link the ’1.8.2 mongodb folder’ to the unversioned folder and ‘hey presto’ everything should just work.

To get an init script working cleanly with this setup, download mine from my Github ‘dotfiles’ repo. Please note – my init script enables journaling and the REST interface (on line 51).

wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/mongod
sudo mv mongod /etc/init.d/mongod
sudo chmod +x /etc/init.d/mongod

You’ll need to add a mongodb user and prep some folders

sudo useradd mongodb
sudo mkdir -p /var/lib/mongodb
sudo mkdir -p /var/log/mongodb
sudo chown mongodb.mongodb /var/lib/mongodb
sudo chown mongodb.mongodb /var/log/mongodb

Also, you need to activate your MongoDB service’s init script by adding it to your system’s run-level configuration. That way the service will startup during the boot sequence and stop nicely during the OS’ shutdown procedure.

sudo update-rc.d mongod defaults

Lastly to launch MongoDB

/etc/init.d/mongod start

Good luck!

UPDATE: Since April 6 Ubuntu now has prefabbed packages containing MongoDB 1.8.1, maintained by 10Gen. See the instruction below.

Former FEMA Chief Michael Brown has a new job sells Snake Oil

This is funny because its classic case of desigining a black magic product thats scans all the databases in the world in-place using its adaptable plugin modules that enables it to extract hidden terrorist messages from your mum’s recipe spreadsheet in her Documents folder and correlate with credit card spending in Indonesia, via the included plugin module that sits atop of the VISA global credit card database.

My favourite line in the pitch is…. and I guarantee that I’m not taking it out of context:

because its distributed, its totally secure

Nuts! As someone working for a company where writing connectors into external systems is a constant drain on development resource, leaving data in-place is not a guaranteed best practice.

Still goes to show… You could be building complete and utter nonsense and get a discredited person like Michael Brown to sell it as snake oil.

Oh what a world….

[podtech content=http://media1.podtech.net/media/2007/08/PID_012101/Podtech_Michael_Brown_on_InferX.flv&postURL=http://www.podtech.net/home/3766/former-fema-chief-michael-brown-on-data-mining&totalTime=832000&breadcrumb=18aaed5837da4ebead6f094f122e0d88]

Compiling ActionScript 3 Corelib compiled for Flex 3 Moxie & Adobe AIR

I’ve been playing around with Adobe AIR and Flex 3 Beta 1… I reserve opinion on these technologies because I haven’t used them enough. But I thought I’d leave a wee tip…

One thing that’s really useful to Flex 3/AIR coders is the ActionScript 3 CoreLib (AS3CoreLib). It contains MD5, JSON, and some other really useful ‘routines’.

Following are guidelines on getting AS3CoreLib compiled for Flex 3 Moxie.

Continue reading

Hoopla

As part of the Upstart Hoopla! project I’ve started programming in Ruby, specifically using RubyOnRails(RoR). RoR an interesting programming language/framwork that is obviously the darling of the industry at the moment.
Its easy to see why… RoR cuts through so much of the redtape that’s associated with frameworks such as J2EE, or even .Net. The Ruby language itself is bit tougher to get to grips with. It has some mannerism that can be currently best described as strange, compared to the stuff I’m used to, i.e. Python & Java. I say “currently” because I’m still learning these mannerisms and fromwhat I’ve read its supposed to be an amazing programming language, once the penny drosp.
Upstart Hoopla is at the time of this writing a blog using the Typo blogging engine (as is this site I might add). I’ve chosen the Typo engine as the foundation for the Upstart project because the code’s in excellent shape and is relatively easy to manipulate into the functonality required for the project.
Hence I’m forking the Typo engine into the Hoopla engine so that it may provide amongst other things:

  • multiple-user signon and registration
  • ‘related article’ functionality
  • relevance-based browsing of tags via user-profiles and a snazzy UI
  • podcast-hosting via Amazon S3

Once these features are made available and have proven to be robust, I’m considering republishing under the same open source license as the Typo engine. The other option is to get in touch with the Typo development team and suggest introducing the additional Hoopla functionality as add-ons or plugins.