Skip to content

Commit 4764b8a

Browse files
author
Bob Grabar
committed
DOCS-929 config server upgrade review edits
1 parent 55af6a4 commit 4764b8a

File tree

1 file changed

+67
-50
lines changed

1 file changed

+67
-50
lines changed

source/release-notes/2.4-upgrade.txt

Lines changed: 67 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Upgrade a Sharded Cluster from 2.2 to 2.4
44

55
.. default-domain:: mongodb
66

7-
Upgrading a sharded cluster from MongoDB version 2.2 to 2.4 (or 2.3)
7+
Upgrading a :term:`sharded cluster` from MongoDB version 2.2 to 2.4 (or 2.3)
88
requires that you run a 2.4 :ref:`config server
9-
<sharding-config-server>` with the :option:`--upgrade <mongod
10-
--upgrade>` option, as explained in detail in this procedure. The
9+
<sharding-config-server>` with the :option:`--upgrade <mongos --upgrade>` option,
10+
as explained in detail in this procedure. The
1111
upgrade can be run without downtime.
1212

1313
The upgrade to MongoDB 2.4 adds epochs to all of the collections and
14-
chunks in the existing cluster. The upgrade is reversible. MongoDB 2.2
14+
chunks in the existing cluster. MongoDB 2.2
1515
processes are capable of handling epochs, even though 2.2 did not
1616
require them.
1717

@@ -22,13 +22,15 @@ While the upgrade is in progress, you cannot make changes to the
2222
collection metadata. For example, you cannot add shards, drop databases,
2323
or drop collections, nor make other metadata changes.
2424

25-
Upgrade a Sharded Cluster from MongoDB version 2.2 to MongoDB version 2.4
26-
-------------------------------------------------------------------------
25+
.. _upgrade-cluster-upgrade:
26+
27+
Upgrade a Sharded Cluster from MongoDB 2.2 to MongoDB 2.4
28+
---------------------------------------------------------
2729

2830
Do not perform metadata operations while performing this procedure.
2931

3032
1. Turn off the :ref:`balancer <sharding-balancing-internals>` in the
31-
sharded cluster, as described in
33+
:term:`sharded cluster`, as described in
3234
:ref:`sharding-balancing-disable-temporally`.
3335

3436
#. Ensure there are no version 2.0 MongoDB processes still active in the
@@ -40,89 +42,104 @@ Do not perform metadata operations while performing this procedure.
4042
#. Start a single versions 2.4 :program:`mongos` process with
4143
:setting:`configdb` pointing to the sharded cluster's :ref:`config
4244
servers <sharding-config-server>` and with the :option:`--upgrade
43-
<mongod --upgrade>` option.
45+
<mongos --upgrade>` option. You can use an existing version 2.4
46+
:program:`mongos` that is able to reach the config servers, or,
47+
alternatively, you can start a new :program:`mongos` to avoid
48+
reconfiguring a production :program:`mongos`.
49+
50+
Issue the command in the following form:
51+
52+
.. code-block:: sh
4453

45-
You can use a new :program:`mongos` process, started on an ``admin``
46-
database, or use an existing version 2.4 :program:`mongos` process
47-
that is able to reach the :ref:`config servers
48-
<sharding-config-server>`.
54+
mongos --configdb <config server> --upgrade
4955

50-
Without the :option:`--upgrade <mongod --upgrade>` option, any
56+
Without the :option:`--upgrade <mongos --upgrade>` option, any
5157
version 2.4 :program:`mongos` processes in the sharded cluster will
5258
fail to start.
5359

60+
The upgrade will prevent any chunk moves or splits from occurring
61+
during the upgrade process. If there are very many sharded
62+
collections, acquiring the locks for these collections may take
63+
seconds or minutes. See the log for progress updates.
64+
5465
#. If the :program:`mongos` process starts successfully, the upgrade has
5566
completed. If the :program:`mongos` process fails to start, check the
5667
log as to why.
5768

69+
If a network interruption occurred and prevented changes, see
70+
:ref:`upgrade-cluster-resyn`.
71+
5872
#. Restart the balancer. You can resume metadata operations.
5973

60-
Once upgraded, introducing v2.0 MongoDB processes back into the sharded
61-
cluster can result in metadata problems - do not do this. In the future
62-
this will be prevented by the upgrade mechanism itself.
74+
#. Restart the other version 2.4 :program:`mongos` processes in the
75+
sharded cluster normally, without the :option:`--upgrade <mongos --upgrade>` option.
6376

64-
The upgrade should require no manual intervention, and will prevent any
65-
chunk moves or splits from occurring during the upgrade process. If
66-
there are very many sharded collections, acquiring the locks for these
67-
collections may take seconds or minutes - the log will have progress
68-
updates.
77+
Once you have upgraded, *do not* introduce version 2.0 MongoDB processes
78+
back into the sharded cluster. This can result in metadata problems. In
79+
future releases, this will be prevented by the upgrade mechanism itself.
6980

70-
Once the upgrade process has completed successfully, it will be possible
71-
to start other v2.4 :program:`mongos` processes in the sharded cluster
72-
normally without the :option:`--upgrade <mongod --upgrade>` option.
81+
.. _upgrade-cluster-resyn:
7382

74-
Network Interruptions
75-
---------------------
83+
Resync after a Network Interruption
84+
-----------------------------------
7685

7786
During the short critical section of the upgrade where changes are
7887
applied, it is unlikely but possible that a network interruption will
7988
prevent changes from being verified or applied to all three config
8089
servers. If this occurs, the :ref:`config servers
8190
<sharding-config-server>` must be re-synced, and there may be problems
82-
starting new mongoses. The sharded cluster will remain active, but
91+
starting new :program:`mongos` processes. The :term:`sharded cluster` will remain active, but
8392
manual metadata operations should be avoided until the re-sync. The
8493
process for re-syncing is as follows:
8594

86-
1. Turn off the balancer in the sharded cluster and stop all metadata
87-
operations (this may already be the case due to preparations above).
95+
1. Turn off the :ref:`balancer <sharding-balancing-internals>` in the
96+
sharded cluster and stop all metadata operations. This may already be
97+
the case because of your having begun the upgrade procedure
98+
(:ref:`upgrade-cluster-upgrade`).
8899

89-
#. Shut down two of the three config servers, preferably the latter two
100+
#. Shut down two of the three config servers, preferably the latter two listed
90101
in the :setting:`configdb` string. For example, if your :setting:`configdb`
91102
string is ``configA:27019,configB:27019,configC:27019``, shut down
92103
``configB`` and ``configC``. Shutting down the last two config servers
93104
ensures that metadata reads will be largely uninterrupted.
94105

95-
#. :program:`Mongodump <mongodump>` the data files of the active config server (configA).
106+
#. :program:`Mongodump <mongodump>` the data files of the active config server (``configA``).
107+
108+
#. Move the data files of the downed config servers (``configB`` and ``configC``)
109+
to a backup location.
96110

97-
#. Move the data files of the downed config servers (``configB``, ``configC``)
98-
to a backup location. Clear out the data directory.
111+
#. Clear out the :term:`data directory <dbpath>`.
99112

100-
#. Restart the downed config servers pointed at the now-empty data
101-
directory on a different port (for example, ``27020``).
113+
#. Restart the downed config servers with :option:`--dbpath <mongod --dbpath>`
114+
pointing to the now-empty data directory and :option:`--port <mongod --port>`
115+
pointing to a different port (for example, ``27020``).
102116

103117
#. :program:`Mongorestore <mongorestore>` the data files from the active
104118
config server (``configA``) to the restarted config servers on the new
105-
port (``configB:27020``, ``configC:27020``). These config servers are now
119+
port (``configB:27020,configC:27020``). These config servers are now
106120
re-synced.
107121

108-
#. Restart the restored config servers on the new port, resetting the
109-
port back to the old settings (configB:27019,configC:27019).
122+
#. Restart the restored config servers on the old port, resetting the
123+
port back to the old settings (``configB:27019,configC:27019``).
110124

111-
#. Connection pooling may cause spurious failures as old connections
112-
are discarded only when used. This problem is fixed in v2.4, but to
113-
avoid this problem in v2.2, you can restart all mongoses (one-by-one,
114-
to avoid downtime) and stepDown and restart replica set primaries.
125+
#. Connection pooling may cause spurious failures, as old connections
126+
are discarded only when used. This problem is fixed in version 2.4, but to
127+
avoid this problem in version 2.2, you can restart all :program:`mongos` instances (one-by-one,
128+
to avoid downtime) and :method:`stepDown <rs.stepDown()>` and restart
129+
the :term:`replica set` :term:`primaries <primary>`.
115130

116131
#. The sharded cluster is now fully resynced, but to retry the upgrade
117-
you must manually reset the upgrade state via a v2.2 mongos. To do so,
118-
run:
132+
you must manually reset the upgrade state via a version 2.2
133+
:program:`mongos`. To do so, connect to the 2.2 :program:`mongos`:
134+
135+
.. code-block:: sh
136+
137+
mongo <2.2 mongos port>
119138

120-
.. code-block:: sh
139+
And then run:
121140

122-
# mongo <mongos>
141+
.. code-block:: javascript
123142

124-
> db.getMongo().getCollection("config.version").update({ _id : 1 }, { $unset : { upgradeState : 1 } })
143+
db.getMongo().getCollection("config.version").update({ _id : 1 }, { $unset : { upgradeState : 1 } })
125144

126-
At this point, you may retry the upgrade process by reintroducing a
127-
version 2.4 :program:`mongos` into the sharded cluster with
128-
:option:`--upgrade <mongod --upgrade>` option.
145+
#. Retry the upgrade process, as described in :ref:`upgrade-cluster-upgrade`.

0 commit comments

Comments
 (0)