In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
3 minutes to complete MongoDB 2.6 upgrade 3.0 Foreword
Part 1: Write at the top
Since version 3.0, MongoDB has supported the WT storage engine, which has a higher compression ratio than the older MMAPv1 storage engine and supports document-level concurrency control. Because of WT's excellent features, WT storage engine has been used as the default storage engine since Mongo DB version 3.2. This article will briefly describe the process and considerations for upgrading 2.6 to 3.0
actual combat
Part 1: Recommendations and checklists
limit
To upgrade to version 3.0, the existing cluster must first be version 2.6. If it is an earlier version, you must upgrade to version 2.6 before upgrading to version 3.0. If authentication mode has been enabled for the 2.6 cluster, authSchema version upgrade is required before upgrading. See the section on authentication for details.
ready
Before you start the upgrade, see compatibility changes in the MongoDB 3.0 documentation to ensure your applications and deployments are compatible with MongoDB 3.0. Resolve incompatibilities in your deployment before you start upgrading.
Before upgrading MongoDB, test your application in a staging environment to ensure that the upgrade goes smoothly
Downgraded version restrictions
After upgrading to 3.0, you can only downgrade to version 2.6.8 or later.
Note: Avoid reconfiguring replica sets that contain members from different MongoDB versions, as permission validation rules may differ in MongoDB versions.
Prerequisites for upgrading lower versions
To upgrade a replica set to 3.0, all replica set members must be running version 2.6. To upgrade a replica set from an earlier MongoDB version, first upgrade all members of the replica set to the latest 2.6 series version, and then follow these steps to upgrade from MongoDB 2.6 to 3.0.
Part 2: Upgrade process
Upgrade a Secondary in the replica set first
Close the mongod instance and replace the bin directory of the 2.6 binary with the bin directory of the 3.0 binary.
Restart the member and wait for the member to revert to Secondary state before promoting the next Secondary member. To check the status of a member, issue rs.status() in the mongo shell.
stepdown Primary in replica set
Connect the mongo shell to the Primary server and use rs.stepDown() to demote the primary server and force other nodes to elect a new Primary server.
Upgrade Primary Server
When rs.status() shows that the original Primary node has become Secondary and the new PRIMARY has been elected, start upgrading the original Primary node:
Close the database and replace the bin directory of the 2.6 binary with the bin directory of the 3.0 binary.
Start the original Primary node.
Part3: About Certification
authSchema
2.6 To upgrade to 3.0, you must first upgrade authSchema.
After running authSchemaUpgrade and upgrading to 3.0, you cannot downgrade to 2.6 and turn on authentication mode
Check if authSchema version is 3.0 (at least)
use admin
db.system.version.find( { _id: "authSchema" })
Upgrade SchemaUpgrade, copy the set, then execute this command in the master library
db.getSiblingDB("admin").runCommand({authSchemaUpgrade: 1 });
Part4: Changing the Storage Engine
You must use MongoDB 3.0 or later to use the WiredTiger storage engine. If upgrading from an earlier version of MongoDB, see the instructions for upgrading to MongoDB 3.0 or upgrading to MongoDB 3.2 before continuing with storage engine changes.
Before enabling the new WiredTiger storage engine, ensure that all replica set/sharding cluster members are running at least MongoDB version 2.6.8 and preferably version 3.0.0 or later. A replica set can have members of different storage engines. So you can update members in a scrolling fashion using the WiredTiger storage engine. You may want to run the hybrid storage engine for a while before changing all members to use WiredTiger. However, performance varies depending on the workload.
Add engine: "wiredTiger" to configurefile and restart the instance after replacing-dbpath
Since dbpath is a new directory, the replica set performs initial sync to resynchronize, and the time to resynchronize depends on the size of the data volume and network conditions.
Prepare the data catalog for a new mongod instance running with the WiredTiger storage engine. Mongod must have read and write permissions on this directory. You can delete the contents of the current data directory of a stopped helper member or create a new directory entirely.
Mongod with WiredTiger doesn't start with data files created using different storage engines.
Part5:Driver compatibility
Most versions of Dirver support 3.0 as well as 3.2.
For more driver compatibility see:
https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/
Warning:
2.6 Upgrade 3.0
After upgrading, you cannot downgrade versions lower than 2.6.8.
2.6 To upgrade to 3.0, you must first upgrade authSchema.
After running authSchemaUpgrade and upgrading to 3.0, you cannot downgrade to 2.6 and turn on authentication mode
- Summary-
As with minor version upgrades, upgrading version 3.0 from version 2.6 is not difficult, mainly because if you have turned on authentication in version 2.6, then you must do a good job of upgrading authSchema and understand the limitations of downgrading. Due to the preparation time is also very hasty, the text will inevitably appear some errors or inaccuracies, inappropriate please readers criticism and correction.
Readers who like it can click on it to pay attention. Your praise and attention are the greatest encouragement and support for the author to continue posting!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.