Upgrading mongodb has no effect and still shows the old version

后端 未结 7 1493
说谎
说谎 2020-12-29 01:51

Following are the commands which I used to upgrade my mongodb version from 2.6.9 to latest, but its still showing me the previous version. Let me know what I am doing wrong

7条回答
  •  囚心锁ツ
    2020-12-29 02:25

    You can replace binaries to upgrade to mongodb 3.0 as follows (works on Ubuntu/CentOs but commands are listed for Ubuntu) :

    1. Download tar from mongodb website as per your destribution from : https://www.mongodb.org/downloads
    2. Untar downloaded file.

      tar -zxvf {mongo-tar-file}.tgz

    3. Stop mongod service.

      sudo service mongod stop

    4. Replace binaries from your tar/bin to /usr/bin.

      cd {your-extracted-folder}/bin

      sudo mv -f * /usr/bin/

    5. Start mongod service.

      sudo service mongod start

    After you connect to mongo after this, you can see version has been updated. I have upgraded in this way on my production servers without any issue.

    You should backup your data before upgrading. Usually no backup/restore is necessary but sometimes things don't go as expected.

提交回复
热议问题