Tag Archives: ubuntu

how to upgrade MongoDB 2.6 to 3.x on Ubuntu

sudo mv /etc/apt/sources.list.d/mongodb* /tmp/
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update && sudo apt-get install -y mongodb-org

And I also had to do fix my replica set in the MongoDB shell (necessary for Meteor oplog tailing):

var a = {"_id" : "rs0", "version" : 1,"members" : [{"_id" : 1, "host" : "localhost:27017"}]};
rs.reconfig(a, {force:true});