Wednesday, March 16, 2011

New Yum Repo for MongoDb

As of February 2011, 10gen has new repositories for getting there latest version. The old repositories still would work but only up to 1.6.5. Here's the new configuration files.
To add the configuration,
# vi /etc/yum.repos.d/10gen.repo , then paste the following information (use only one appropriate for your server)

For CentOS 5.4 and Fedora on x86_64(64-bit)
#------ copy after this line --------
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
#------ end copy --------- 

For CentOS 5.4 and Fedora on x86(32-bit)
#------ copy after this line ---------
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
gpgcheck=0
#------ end copy ---------
Now, you can upgrade your MongoDb. For versions earlier than 2/2011 you will need to remove your installed mongo-stable and mongo-stable-server.
To remove mongo-stable, mongo-stable-server
# yum remove mongo-stable mongo-stable-server
Now that your system is clear, finally install mongodb.
Install the new mongodb packages
# yum install mongo-10gen mongo-10gen-server
You would notice that the packages have now names of which versions you are installing. After the above exercise, to update, you will only have to do the following.

Upgrade mongodb packages
# yum upgrade mongo-10gen mongo-10gen-server
  • Related Links Widget for Blogspot

2 comments:

Anonymous said...

To clarify, will uninstalling the mongo server (before upgrading) delete any databases?

Unknown said...

It shouldn't. The server is separate from data (BSON) and barely changes from server version to server version. Just make sure you know where you put it if your db path is custom. And as any good Sys Ad practice, always backup.