Trouble Installing MongoDB on Amazon Linux

/

I have spent the last two years developing against different noSQL databases, sometimes just small projects to get the feel for them. I'm moving my latest project from CouchDB to MongoDB after about a year off of using mongo with any seriousness. Therefore it needed to be freshly installed on one of my current development machines, in this case an Amazon Linux instance at AWS.

Up till now, installing anything on an Amazon Linux AMI has been trivially simple.

[shell] sudo yum install /whatever/

In this case I was installing 'mongodb' and 'mongodb-server', so it was a little disappointing to find that

[shell] sudo /etc/init.d/mongodb start  

looked like it went ahead just fine, but when I tried to connect with the mongo shell. I could not connect. Silent failure somewhere. After checking some config options, everything looked right, so over to the log file:

/usr/bin/mongod: symbol lookup error: /usr/bin/mongod: undefined symbol: _ZN7pcrecpp2RE4InitEPKcPKNS_10RE_OptionsE
about to fork child process, waiting until server is ready for connections.

Picking up from the error "pcrecpp" most likely something with my version of the pcre library and the mongo binaries. After some not so quick fix attempts, I found a very simple one:

  • Went to the downloads page at mongodb and downloaded the latest linux version.
  • Extracted
  • Then copied the binaries to replace the yum installed versions in /usr/bin.

Everything works just fine now.