Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
mongo_upgrade [2019/09/10 19:55] – [Upgrade to 4.2] andonovj | mongo_upgrade [2019/10/18 20:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Overview===== | + | ======Overview====== |
- | Upgrading in mongo is performed | + | The upgrade of Mongo can be performed |
- | If you are like me and started with old release like 2.6, then you are screwed because you will have to pass through a lot of upgrades to reach the current one (4.3). | + | |
- | So let's get going: | + | |
- | =====Upgrade | + | * [[mongo_upgrade_binaries|Upgrade |
- | In order to upgrade from 2.6 to 4.3 we have to do the following: | + | |
- | - Upgrade | + | This method involves upgrading to binaries |
- | - Upgrade database features in versions: 3.4, 3.6, 4.0, 4.2, 4.3 | + | |
- | - Upgrade the authentication schema in: 3.6 | + | |
- | So let's get going: | + | * [[mongo_upgrade_logical|Migrate to newer version]] |
- | ====Upgrade to 3.0==== | + | This method is way better if you are staring from old release (e.g. 2.6). In nutshell, you will perform a logical export and import into the newer release. However there are some limitations to that method. |
- | The upgrades until 3.4 are so called " | + | |
- | - Stop the server | ||
- | - Modify the yum configuration file | ||
- | - Upgrade the libraries | ||
- | - Start the server | ||
- | - Check the version | ||
- | ===Stop the server=== | ||
- | As I mentioned, stopping of the server can be done gracefully or killfully. Let's do it killfully (not recommended though) | ||
- | |||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | root 5275 | ||
- | root 6258 4382 0 07:35 pts/0 00:00:00 grep --color=auto mongo | ||
- | [root@localhost yum.repos.d]# | ||
- | [root@localhost yum.repos.d]# | ||
- | root 6267 4382 0 07:35 pts/0 00:00:00 grep --color=auto mongo | ||
- | </ | ||
- | |||
- | ===Modify yum config file=== | ||
- | In order to upgrade the libraries, we have to add new entry in the / | ||
- | |||
- | <sxh bash> | ||
- | ******************************* | ||
- | [mongodb-org-3.0] | ||
- | name=MongoDB Repository | ||
- | baseurl=https:// | ||
- | gpgcheck=1 | ||
- | enabled=1 | ||
- | gpgkey=https:// | ||
- | </ | ||
- | |||
- | Once it is added, we can upgrade to the new version: | ||
- | |||
- | ===Upgrade the libraries=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.vectranet.pl | ||
- | * extras: ftp.agh.edu.pl | ||
- | * updates: ftp.man.poznan.pl | ||
- | mongodb-org-2.6 | ||
- | mongodb-org-3.0 | ||
- | mongodb-org-3.0/ | ||
- | ============================================================================================================ N/S matched: mongo ============================================================================================================= | ||
- | google-noto-sans-mongolian-fonts.noarch : Sans Mongolian font | ||
- | mongodb-org.x86_64 : MongoDB open source document-oriented database system (metapackage) | ||
- | mongodb-org-mongos.x86_64 : MongoDB sharded cluster query router | ||
- | mongodb-org-server.x86_64 : MongoDB database server | ||
- | mongodb-org-shell.x86_64 : MongoDB shell client | ||
- | mongodb-org-tools.x86_64 : MongoDB tools | ||
- | autocorr-mn.noarch : Mongolian auto-correction rules | ||
- | hunspell-mn.noarch : Mongolian hunspell dictionaries | ||
- | hyphen-mn.noarch : Mongolian hyphenation rules | ||
- | |||
- | Name and summary matches only, use " | ||
- | [root@localhost yum.repos.d]# | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.vectranet.pl | ||
- | * extras: ftp.agh.edu.pl | ||
- | * updates: ftp.man.poznan.pl | ||
- | Resolving Dependencies | ||
- | --> Running transaction check | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | --> Finished Dependency Resolution | ||
- | |||
- | Dependencies Resolved | ||
- | |||
- | ============================================================================================================================================================================================================================================= | ||
- | | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Updating: | ||
- | | ||
- | |||
- | Transaction Summary | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Upgrade | ||
- | |||
- | Total download size: 13 M | ||
- | Is this ok [y/d/N]: y | ||
- | Downloading packages: | ||
- | Delta RPMs disabled because / | ||
- | warning: / | ||
- | Public key for mongodb-org-server-3.0.22-1.el7.x86_64.rpm is not installed | ||
- | mongodb-org-server-3.0.22-1.el7.x86_64.rpm | ||
- | Retrieving key from https:// | ||
- | Importing GPG key 0xEA312927: | ||
- | | ||
- | | ||
- | | ||
- | Is this ok [y/N]: y | ||
- | Running transaction check | ||
- | Running transaction test | ||
- | Transaction test succeeded | ||
- | Running transaction | ||
- | Updating | ||
- | Cleanup | ||
- | Verifying | ||
- | Verifying | ||
- | |||
- | Updated: | ||
- | mongodb-org-server.x86_64 0: | ||
- | |||
- | Complete! | ||
- | </ | ||
- | |||
- | And voila, the mongo was upgraded from 2.6 -> 3.0. | ||
- | Now, let's verify if all was fine with the upgrade: | ||
- | |||
- | ===Start the server=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | about to fork child process, waiting until server is ready for connections. | ||
- | forked process: 5275 | ||
- | child process started successfully, | ||
- | [root@localhost yum.repos.d]# | ||
- | </ | ||
- | |||
- | ===Check the version=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | MongoDB shell version: 3.0.15 | ||
- | connecting to: 192.168.0.172: | ||
- | Server has startup warnings: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | rs0: | ||
- | ExampleDB | ||
- | admin 0.078GB | ||
- | local 2.077GB | ||
- | test | ||
- | rs0: | ||
- | 3.0.22 <- Very happy | ||
- | </ | ||
- | |||
- | So let's continue then. | ||
- | |||
- | |||
- | ====Upgrade to 3.2==== | ||
- | One again: | ||
- | |||
- | ===Stop the server=== | ||
- | P.S. THIS ISN'T RECOMMENDED WAY TO STOP IT, please addess " | ||
- | |||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | root 5275 | ||
- | root 6258 4382 0 07:35 pts/0 00:00:00 grep --color=auto mongo | ||
- | [root@localhost yum.repos.d]# | ||
- | [root@localhost yum.repos.d]# | ||
- | root 6267 4382 0 07:35 pts/0 00:00:00 grep --color=auto mongo | ||
- | </ | ||
- | |||
- | ===Modify the yum config file=== | ||
- | <sxh bash> | ||
- | ************************************ | ||
- | [mongodb-org-3.2] | ||
- | name=MongoDB Repository | ||
- | baseurl=https:// | ||
- | gpgcheck=1 | ||
- | enabled=1 | ||
- | gpgkey=https:// | ||
- | </ | ||
- | |||
- | ===Upgrade the libraries=== | ||
- | |||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.vectranet.pl | ||
- | * extras: ftp.agh.edu.pl | ||
- | * updates: ftp.man.poznan.pl | ||
- | mongodb-org-3.0 | ||
- | mongodb-org-3.2 | ||
- | mongodb-org-3.2/ | ||
- | ============================================================================================================ N/S matched: mongo ============================================================================================================= | ||
- | google-noto-sans-mongolian-fonts.noarch : Sans Mongolian font | ||
- | mongodb-org.x86_64 : MongoDB open source document-oriented database system (metapackage) | ||
- | mongodb-org-mongos.x86_64 : MongoDB sharded cluster query router | ||
- | mongodb-org-server.x86_64 : MongoDB database server | ||
- | mongodb-org-shell.x86_64 : MongoDB shell client | ||
- | mongodb-org-tools.x86_64 : MongoDB tools | ||
- | autocorr-mn.noarch : Mongolian auto-correction rules | ||
- | hunspell-mn.noarch : Mongolian hunspell dictionaries | ||
- | hyphen-mn.noarch : Mongolian hyphenation rules | ||
- | |||
- | Name and summary matches only, use " | ||
- | [root@localhost yum.repos.d]# | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.vectranet.pl | ||
- | * extras: ftp.agh.edu.pl | ||
- | * updates: ftp.man.poznan.pl | ||
- | Resolving Dependencies | ||
- | --> Running transaction check | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | --> Finished Dependency Resolution | ||
- | |||
- | Dependencies Resolved | ||
- | |||
- | ============================================================================================================================================================================================================================================= | ||
- | | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Updating: | ||
- | | ||
- | |||
- | Transaction Summary | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Upgrade | ||
- | |||
- | Total download size: 13 M | ||
- | Is this ok [y/d/N]: y | ||
- | Downloading packages: | ||
- | Delta RPMs disabled because / | ||
- | warning: / | ||
- | Public key for mongodb-org-server-3.2.22-1.el7.x86_64.rpm is not installed | ||
- | mongodb-org-server-3.2.22-1.el7.x86_64.rpm | ||
- | Retrieving key from https:// | ||
- | Importing GPG key 0xEA312927: | ||
- | | ||
- | | ||
- | | ||
- | Is this ok [y/N]: y | ||
- | Running transaction check | ||
- | Running transaction test | ||
- | Transaction test succeeded | ||
- | Running transaction | ||
- | Updating | ||
- | Cleanup | ||
- | Verifying | ||
- | Verifying | ||
- | |||
- | Updated: | ||
- | mongodb-org-server.x86_64 0: | ||
- | |||
- | Complete! | ||
- | </ | ||
- | |||
- | ===Start the server=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | about to fork child process, waiting until server is ready for connections. | ||
- | forked process: 6371 | ||
- | child process started successfully, | ||
- | </ | ||
- | |||
- | ===Check the version=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | MongoDB shell version: 3.0.15 | ||
- | connecting to: 192.168.0.172: | ||
- | Server has startup warnings: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | rs0: | ||
- | 3.2.22 | ||
- | rs0: | ||
- | </ | ||
- | |||
- | ====Upgrade to 3.4==== | ||
- | And again :) | ||
- | |||
- | ===Shutdown server=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | root 6371 | ||
- | root 6559 4382 0 07:39 pts/0 00:00:00 grep --color=auto mongo | ||
- | [root@localhost yum.repos.d]# | ||
- | [root@localhost yum.repos.d]# | ||
- | root 6567 4382 0 07:39 pts/0 00:00:00 grep --color=auto mongo | ||
- | </ | ||
- | |||
- | |||
- | ===Modify the yum config file=== | ||
- | <sxh bash> | ||
- | ************************************************************************** | ||
- | [mongodb-org-3.4] | ||
- | name=MongoDB Repository | ||
- | baseurl=https:// | ||
- | gpgcheck=1 | ||
- | enabled=1 | ||
- | gpgkey=https:// | ||
- | </ | ||
- | |||
- | ===Upgrade the libraries=== | ||
- | |||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.upjs.sk | ||
- | * extras: ftp.upjs.sk | ||
- | * updates: ftp.upjs.sk | ||
- | mongodb-org-3.0 | ||
- | mongodb-org-3.2 | ||
- | mongodb-org-3.4 | ||
- | mongodb-org-3.4/ | ||
- | ============================================================================================================ N/S matched: mongo ============================================================================================================= | ||
- | google-noto-sans-mongolian-fonts.noarch : Sans Mongolian font | ||
- | mongodb-org.x86_64 : MongoDB open source document-oriented database system (metapackage) | ||
- | mongodb-org-mongos.x86_64 : MongoDB sharded cluster query router | ||
- | mongodb-org-server.x86_64 : MongoDB database server | ||
- | mongodb-org-shell.x86_64 : MongoDB shell client | ||
- | mongodb-org-tools.x86_64 : MongoDB tools | ||
- | autocorr-mn.noarch : Mongolian auto-correction rules | ||
- | hunspell-mn.noarch : Mongolian hunspell dictionaries | ||
- | hyphen-mn.noarch : Mongolian hyphenation rules | ||
- | |||
- | Name and summary matches only, use " | ||
- | [root@localhost yum.repos.d]# | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: ftp.vectranet.pl | ||
- | * extras: ftp.agh.edu.pl | ||
- | * updates: ftp.man.poznan.pl | ||
- | Resolving Dependencies | ||
- | --> Running transaction check | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | --> Finished Dependency Resolution | ||
- | |||
- | Dependencies Resolved | ||
- | |||
- | ============================================================================================================================================================================================================================================= | ||
- | | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Updating: | ||
- | | ||
- | |||
- | Transaction Summary | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Upgrade | ||
- | |||
- | Total download size: 20 M | ||
- | Is this ok [y/d/N]: y | ||
- | Downloading packages: | ||
- | Delta RPMs disabled because / | ||
- | warning: / | ||
- | Public key for mongodb-org-server-3.4.22-1.el7.x86_64.rpm is not installed | ||
- | mongodb-org-server-3.4.22-1.el7.x86_64.rpm | ||
- | Retrieving key from https:// | ||
- | Importing GPG key 0xA15703C6: | ||
- | | ||
- | | ||
- | | ||
- | Is this ok [y/N]: y | ||
- | Running transaction check | ||
- | Running transaction test | ||
- | Transaction test succeeded | ||
- | Running transaction | ||
- | Updating | ||
- | Cleanup | ||
- | Verifying | ||
- | Verifying | ||
- | |||
- | Updated: | ||
- | mongodb-org-server.x86_64 0: | ||
- | |||
- | Complete! | ||
- | </ | ||
- | |||
- | |||
- | ===Start the server=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | about to fork child process, waiting until server is ready for connections. | ||
- | forked process: 6649 | ||
- | child process started successfully, | ||
- | [root@localhost yum.repos.d]# | ||
- | </ | ||
- | |||
- | ===Verify the version=== | ||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | MongoDB shell version: 3.0.15 | ||
- | connecting to: 192.168.0.172: | ||
- | Server has startup warnings: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | rs0: | ||
- | 3.4.22 | ||
- | rs0: | ||
- | </ | ||
- | |||
- | Now I know that this was boring BUT, I wanted to reach at least up to 3.4 so I can show you what happens if you don't upgrade the datafiles as well. If you continue like that and upgrade to 3.6, without upgrading the datafiles, you will receive the following error: | ||
- | |||
- | |||
- | <sxh bash> | ||
- | [root@localhost yum.repos.d]# | ||
- | about to fork child process, waiting until server is ready for connections. | ||
- | forked process: 7100 | ||
- | ERROR: child process failed, exited with error number 62 | ||
- | </ | ||
- | |||
- | That pretty much says, that there was a problem starting the server, but no what is THE PROBLEM :) You can find more info in the LOG file, whose location is configured in the main config file (e.g. / | ||
- | |||
- | <sxh bash> | ||
- | 2019-09-10T07: | ||
- | 2019-09-10T07: | ||
- | </ | ||
- | |||
- | So in order to not encounter that (because if we encounter it we have to delete the 3.6, install 3.4 and do what we will do now :) ) | ||
- | We have to upgrade also the datafiles | ||
- | |||
- | ===Upgrade datafiles=== | ||
- | It is done very easy. Just login on the server and execute: db.adminCommand( { setFeatureCompatibilityVersion: | ||
- | |||
- | <sxh bash> | ||
- | [root@localhost ~]# mongo | ||
- | MongoDB shell version: 3.0.15 | ||
- | connecting to: test | ||
- | Server has startup warnings: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | 2019-09-10T08: | ||
- | > db.version() | ||
- | 3.4.22 | ||
- | > db.adminCommand( { setFeatureCompatibilityVersion: | ||
- | { " | ||
- | > | ||
- | > | ||
- | > | ||
- | </ | ||
- | |||
- | You can verify which is the current version of the datafiles using the following command: | ||
- | |||
- | <sxh bash> | ||
- | > db.adminCommand( { getParameter: | ||
- | { " | ||
- | </ | ||
- | |||
- | And that is that, so let's continue to 3.6 and then I will skip it till 4.3 :) | ||
- | |||
- | ====Upgrade to 3.6==== | ||
- | Remember that we should perform that step from now on :) | ||
- | |||
- | |||
- | ===Shutdown the server=== | ||
- | This time we will do it gracefully to see that I also have hearth :) | ||
- | |||
- | <sxh bash> | ||
- | [root@localhost ~]# mongo localhost: | ||
- | MongoDB shell version: 3.0.15 | ||
- | connecting to: localhost: | ||
- | 2019-09-10T09: | ||
- | server should be down... | ||
- | </ | ||
- | |||
- | |||
- | ===Modify yum config file=== | ||
- | <sxh bash> | ||
- | *********************************************************** | ||
- | [mongodb-org-3.6] | ||
- | name=MongoDB Repository | ||
- | baseurl=https:// | ||
- | gpgcheck=1 | ||
- | enabled=1 | ||
- | gpgkey=https:// | ||
- | </ | ||
- | |||
- | |||
- | ===Upgrade the libraries=== | ||
- | <sxh bash> | ||
- | [root@localhost ~]# yum search mongo | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: mirror.it4i.cz | ||
- | * extras: mirror.it4i.cz | ||
- | * updates: mirror.it4i.cz | ||
- | ============================================================================================================ N/S matched: mongo ============================================================================================================= | ||
- | google-noto-sans-mongolian-fonts.noarch : Sans Mongolian font | ||
- | mongodb-org.x86_64 : MongoDB open source document-oriented database system (metapackage) | ||
- | mongodb-org-mongos.x86_64 : MongoDB sharded cluster query router | ||
- | mongodb-org-server.x86_64 : MongoDB database server | ||
- | mongodb-org-shell.x86_64 : MongoDB shell client | ||
- | mongodb-org-tools.x86_64 : MongoDB tools | ||
- | autocorr-mn.noarch : Mongolian auto-correction rules | ||
- | hunspell-mn.noarch : Mongolian hunspell dictionaries | ||
- | hyphen-mn.noarch : Mongolian hyphenation rules | ||
- | |||
- | Name and summary matches only, use " | ||
- | [root@localhost ~]# yum install mongodb-org-server.x86_64 | ||
- | Loaded plugins: fastestmirror, | ||
- | Loading mirror speeds from cached hostfile | ||
- | * base: mirror.it4i.cz | ||
- | * extras: mirror.it4i.cz | ||
- | * updates: mirror.it4i.cz | ||
- | mongodb-org-3.0 | ||
- | mongodb-org-3.2 | ||
- | mongodb-org-3.4 | ||
- | mongodb-org-3.6 | ||
- | Resolving Dependencies | ||
- | --> Running transaction check | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | ---> Package mongodb-org-server.x86_64 0: | ||
- | --> Finished Dependency Resolution | ||
- | |||
- | Dependencies Resolved | ||
- | |||
- | ============================================================================================================================================================================================================================================= | ||
- | | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Updating: | ||
- | | ||
- | |||
- | Transaction Summary | ||
- | ============================================================================================================================================================================================================================================= | ||
- | Upgrade | ||
- | |||
- | Total download size: 20 M | ||
- | Is this ok [y/d/N]: y | ||
- | Downloading packages: | ||
- | Delta RPMs disabled because / | ||
- | mongodb-org-server-3.6.14-1.el7.x86_64.rpm | ||
- | Running transaction check | ||
- | Running transaction test | ||
- | Transaction test succeeded | ||
- | Running transaction | ||
- | Updating | ||
- | Cleanup | ||
- | Verifying | ||
- | Verifying | ||
- | |||
- | Updated: | ||
- | mongodb-org-server.x86_64 0: | ||
- | |||
- | Complete! | ||
- | [root@localhost ~]# | ||
- | </ | ||
- | |||
- | |||
- | ===Start the server=== | ||
- | <sxh bash> | ||
- | [root@localhost ~]# /bin/mongod -f / | ||
- | about to fork child process, waiting until server is ready for connections. | ||
- | forked process: 5010 | ||
- | child process started successfully, | ||
- | [root@localhost ~]# ps -ef | grep mongo^C | ||
- | [root@localhost ~]# mongo | ||
- | MongoDB shell version: 3.0.15 | ||
- | connecting to: test | ||
- | Server has startup warnings: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | 2019-09-10T09: | ||
- | > db.version() | ||
- | 3.6.14 | ||
- | > db.adminCommand( { getParameter: | ||
- | { " | ||
- | </ | ||
- | |||
- | |||
- | ===Upgrade the database features=== | ||
- | <sxh bash> | ||
- | > db.adminCommand( { setFeatureCompatibilityVersion: | ||
- | { " | ||
- | > db.adminCommand( { getParameter: | ||
- | { " | ||
- | > | ||
- | </ | ||
- | |||
- | ====Upgrade to 4.0==== | ||
- | I know this is getting annoying, but there are other specifics actions which should be done when upgrading to 4.0: Authentication schema upgrade. | ||
- | |||
- | |||
- | In nutshell, the default authentication schema: Mongo-CR is removed in Mongo >= 4.X. Therefore we have to upgraded latest when we are Mongo 3.6. | ||
- | |||
- | Therefore, we have to: | ||
- | * Enable authentication | ||
- | * Upgrade authentication schema | ||
- | |||
- | Please follow the procedures for these two tasks in: [[mongo_usrs_roles| Users & Roles]] | ||
- | |||
- | After you upgrade the autnetication schema, there is ALSO something specific when upgrading to 4.2 | ||
- | |||
- | ====Upgrade to 4.2==== | ||
- | I know I am exhausting with that, but blame Mongo not me :) | ||
- | |||
- | Since 4.2 the storage engine: MMAPv1 is depricated, therefore we have to change it to the default for >=4.2: WiredTiger: | ||
- | |||
- | The procedure for that can be found at: [[mongo_management| Management]]: | ||
- | |||
- | After that the upgrade to 4.2 can continue as previous ones. |