Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MongoDB upgrade-from 3.4 to 3.6

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Upgrade a Replica Set from 3.4 to 3.6?

1) execute db.adminCommand in master ({getParameter: 1, featureCompatibilityVersion: 1})

Result

{"featureCompatibilityVersion": {"version": "3.4"}," ok ": 1}

2) execute db.adminCommand ({setFeatureCompatibilityVersion: "3.4"}) on master successfully

Note: this step must be completed

3) close the secondary node instance, replace the software and hardware version 3.4 with version 3.6, and then start the secondary node

Note: if you have config configuration information in the directory, you must copy the config configuration information as it is to the version 3.6 directory

4) switch between master and slave. It is recommended to use rs.reconfig (), when the master node becomes the secondary node.

Rs.stepDown () is recommended in official documents, which is unreliable.

5) change the software of the original master node and now secondary from 3.4 to 3.6, and then start the secondary node

Notice the config configuration folder

6) stop the voting node, upgrade the voting software, and then start the voting node.

7) execute db.adminCommand ({getParameter: 1, featureCompatibilityVersion: 1}) on the master node at this time

The result is still: {"featureCompatibilityVersion": {"version": "3.4"}," ok ": 1}

8) switch between master and slave nodes in the master node again, b and check whether the status of each node is normal

9) 8) after successful execution, execute db.adminCommand on the current master node ({setFeatureCompatibilityVersion: "3.6"})

The execution result is:

{

"ok": 1

OperationTime: Timestamp (1531483378, 1)

"$clusterTime": {

ClusterTime: Timestamp (1531483378, 1)

"signature": {

"hash": BinData (0, "x22wHyiBqjmax HuEenVyec6JKDL38 =")

"keyId": NumberLong ("6577658765040943117")

}

}

}

Success

10) Test whether 3.6 new and old function points are normal. And check the log carefully.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report