|
| 1 | +title: "Download the latest |oldversion| binaries." |
| 2 | +level: 4 |
| 3 | +ref: 3.6-downgrade-binaries-sharded-cluster |
| 4 | +content: | |
| 5 | + Using either a package manager or a manual download, get the latest |
| 6 | + release in the |oldversion| series. If using a package manager, add a new |
| 7 | + repository for the |oldversion| binaries, then perform the actual downgrade |
| 8 | + process. |
| 9 | +
|
| 10 | + .. include:: /includes/3.6-downgrade-path.rst |
| 11 | +--- |
| 12 | +title: Disable the Balancer. |
| 13 | +level: 4 |
| 14 | +ref: disable-balancer |
| 15 | +content: | |
| 16 | + Turn off the balancer as described in |
| 17 | + :ref:`sharding-balancing-disable-temporarily`. |
| 18 | +--- |
| 19 | +title: "Downgrade the ``mongos`` instances." |
| 20 | +level: 4 |
| 21 | +ref: downgrade-mongos |
| 22 | +content: | |
| 23 | + Downgrade the binaries and restart. |
| 24 | +--- |
| 25 | +title: Downgrade each shard, one at a time. |
| 26 | +level: 4 |
| 27 | +ref: 3.6-downgrade-shard |
| 28 | +content: | |
| 29 | +
|
| 30 | + Downgrade the shards one at a time. If the shards are replica sets, for each shard: |
| 31 | +
|
| 32 | + 1. Downgrade the :ref:`secondary <replica-set-secondary-members>` |
| 33 | + members of the replica set one at a time: |
| 34 | +
|
| 35 | + a. Shut down the :program:`mongod` instance and replace the |newversion| |
| 36 | + binary with the |oldversion| binary. |
| 37 | +
|
| 38 | + #. Start the |oldversion| binary with the ``--shardsvr`` and |
| 39 | + ``--port`` command line options. Include any other |
| 40 | + configuration as appropriate for your deployment, e.g. |
| 41 | + ``--bind_ip``. |
| 42 | + |
| 43 | + .. code-block:: sh |
| 44 | +
|
| 45 | + mongod --shardsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address> |
| 46 | +
|
| 47 | + Or if using a :doc:`configuration file |
| 48 | + </reference/configuration-options>`, update the file to |
| 49 | + include :setting:`sharding.clusterRole: shardsvr |
| 50 | + <sharding.clusterRole>`, :setting:`net.port`, and any other |
| 51 | + configuration as appropriate for your deployment, e.g. |
| 52 | + :setting:`net.bindIp`, and start: |
| 53 | +
|
| 54 | + .. code-block:: yaml |
| 55 | +
|
| 56 | + sharding: |
| 57 | + clusterRole: shardsvr |
| 58 | + net: |
| 59 | + port: <port> |
| 60 | + bindIp: localhost,<ip address> |
| 61 | + storage: |
| 62 | + dbpath: <path> |
| 63 | +
|
| 64 | +
|
| 65 | + #. Wait for the member to recover to ``SECONDARY`` state before |
| 66 | + downgrading the next secondary member. To check the member's |
| 67 | + state, you can issue :method:`rs.status()` in the |
| 68 | + :program:`mongo` shell. |
| 69 | +
|
| 70 | + Repeat for each secondary member. |
| 71 | +
|
| 72 | + #. Step down the replica set primary. |
| 73 | +
|
| 74 | + Connect a :program:`mongo` shell to the primary and use |
| 75 | + :method:`rs.stepDown()` to step down the primary and force an |
| 76 | + election of a new primary: |
| 77 | +
|
| 78 | + .. code-block:: javascript |
| 79 | +
|
| 80 | + rs.stepDown() |
| 81 | +
|
| 82 | + #. When :method:`rs.status()` |
| 83 | + shows that the primary has stepped down and another member |
| 84 | + has assumed ``PRIMARY`` state, downgrade the stepped-down primary: |
| 85 | +
|
| 86 | + 1. Shut down the stepped-down primary and replace the |
| 87 | + :program:`mongod` binary with the |oldversion| binary. |
| 88 | +
|
| 89 | + #. Start the |oldversion| binary with the ``--shardsvr`` and |
| 90 | + ``--port`` command line options. Include any other |
| 91 | + configuration as appropriate for your deployment, e.g. |
| 92 | + ``--bind_ip``. |
| 93 | + |
| 94 | + .. code-block:: sh |
| 95 | +
|
| 96 | + mongod --shardsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address> |
| 97 | +
|
| 98 | + Or if using a :doc:`configuration file |
| 99 | + </reference/configuration-options>`, update the file to |
| 100 | + include :setting:`sharding.clusterRole: shardsvr |
| 101 | + <sharding.clusterRole>`, :setting:`net.port`, and any other |
| 102 | + configuration as appropriate for your deployment, e.g. |
| 103 | + :setting:`net.bindIp`, and start the |oldversion| binary: |
| 104 | +
|
| 105 | + .. code-block:: yaml |
| 106 | +
|
| 107 | + sharding: |
| 108 | + clusterRole: shardsvr |
| 109 | + net: |
| 110 | + port: <port> |
| 111 | + bindIp: localhost,<ip address> |
| 112 | + storage: |
| 113 | + dbpath: <path> |
| 114 | +--- |
| 115 | +title: "Downgrade the config servers." |
| 116 | +level: 4 |
| 117 | +ref: 3.6-downgrade-config-servers |
| 118 | +content: |- |
| 119 | + If the config servers are replica sets: |
| 120 | + |
| 121 | + 1. Downgrade the :ref:`secondary <replica-set-secondary-members>` |
| 122 | + members of the replica set one at a time: |
| 123 | +
|
| 124 | + a. Shut down the secondary :program:`mongod` instance and replace |
| 125 | + the |newversion| binary with the |oldversion| binary. |
| 126 | +
|
| 127 | + #. Start the |oldversion| binary with both the ``--configsvr`` and |
| 128 | + ``--port`` options. Include any other |
| 129 | + configuration as appropriate for your deployment, e.g. |
| 130 | + ``--bind_ip``. |
| 131 | +
|
| 132 | + .. code-block:: sh |
| 133 | +
|
| 134 | + mongod --configsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address> |
| 135 | +
|
| 136 | + If using a :doc:`configuration file |
| 137 | + </reference/configuration-options>`, update the file to |
| 138 | + specify :setting:`sharding.clusterRole: configsvr |
| 139 | + <sharding.clusterRole>`, :setting:`net.port`, and any other |
| 140 | + configuration as appropriate for your deployment, e.g. |
| 141 | + :setting:`net.bindIp`, and start the |oldversion| binary: |
| 142 | +
|
| 143 | + .. code-block:: yaml |
| 144 | +
|
| 145 | + sharding: |
| 146 | + clusterRole: configsvr |
| 147 | + net: |
| 148 | + port: <port> |
| 149 | + bindIp: localhost,<ip address> |
| 150 | + storage: |
| 151 | + dbpath: <path> |
| 152 | +
|
| 153 | + Include any other configuration as appropriate for your deployment. |
| 154 | +
|
| 155 | + #. Wait for the member to recover to ``SECONDARY`` state before |
| 156 | + downgrading the next secondary member. To check the member's state, |
| 157 | + issue :method:`rs.status()` in the :program:`mongo` shell. |
| 158 | +
|
| 159 | + Repeat for each secondary member. |
| 160 | +
|
| 161 | + #. Step down the replica set primary. |
| 162 | +
|
| 163 | + a. Connect a :program:`mongo` shell to the primary and use |
| 164 | + :method:`rs.stepDown()` to step down the primary and force an |
| 165 | + election of a new primary: |
| 166 | +
|
| 167 | + .. code-block:: javascript |
| 168 | +
|
| 169 | + rs.stepDown() |
| 170 | +
|
| 171 | + #. When :method:`rs.status()` shows that the primary has stepped |
| 172 | + down and another member has assumed ``PRIMARY`` state, shut down |
| 173 | + the stepped-down primary and replace the :program:`mongod` binary |
| 174 | + with the |oldversion| binary. |
| 175 | +
|
| 176 | + #. Start the |oldversion| binary with both the ``--configsvr`` and |
| 177 | + ``--port`` options. Include any other |
| 178 | + configuration as appropriate for your deployment, e.g. |
| 179 | + ``--bind_ip``. |
| 180 | +
|
| 181 | + .. code-block:: sh |
| 182 | +
|
| 183 | + mongod --configsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address> |
| 184 | +
|
| 185 | + If using a :doc:`configuration file |
| 186 | + </reference/configuration-options>`, update the file to |
| 187 | + specify :setting:`sharding.clusterRole: configsvr |
| 188 | + <sharding.clusterRole>`, :setting:`net.port`, and any other |
| 189 | + configuration as appropriate for your deployment, e.g. |
| 190 | + :setting:`net.bindIp`, and start the |oldversion| binary: |
| 191 | +
|
| 192 | + .. code-block:: yaml |
| 193 | +
|
| 194 | + sharding: |
| 195 | + clusterRole: configsvr |
| 196 | + net: |
| 197 | + port: <port> |
| 198 | + bindIp: localhost,<ip address> |
| 199 | + storage: |
| 200 | + dbpath: <path> |
| 201 | +
|
| 202 | +--- |
| 203 | +title: "Re-enable the balancer." |
| 204 | +level: 4 |
| 205 | +ref: reenable-balancer |
| 206 | +content: | |
| 207 | + Once the downgrade of sharded cluster components is |
| 208 | + complete, :ref:`re-enable the balancer <sharding-balancing-enable>`. |
| 209 | +... |
0 commit comments