Skip to content

Commit 81336a2

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-25917 dedicated-config-servers-optional (#2897)
* DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * DOCSP-25917-dedicated-config-servers-optional * Update glossary.txt * Update glossary.txt * Update glossary.txt --------- Co-authored-by: jason-price-mongodb <[email protected]>
1 parent c1c6ceb commit 81336a2

12 files changed

+421
-0
lines changed

source/core/sharded-cluster-config-servers.txt

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ same config servers for different sharded clusters.
4848
number of config servers impacted, the cluster may be read-only or
4949
offline for a period of time.
5050

51+
Starting in MongoDB 7.0, you can configure a config server to store
52+
application data in addition to the usual sharded cluster metadata. The
53+
config server is then known as a *config shard*. You'll learn more later
54+
on this page in the :ref:`sharded-cluster-config-server-config-shards`
55+
section.
56+
5157
.. _csrs:
5258
.. _replset-config-servers:
5359

@@ -176,3 +182,130 @@ appropriate security settings in order to enforce internal authentication.
176182

177183
See :doc:`/tutorial/deploy-sharded-cluster-with-keyfile-access-control` for a
178184
tutorial on deploying a secured sharded cluster.
185+
186+
.. _sharded-cluster-config-server-config-shards:
187+
188+
Config Shards
189+
-------------
190+
191+
.. include:: /includes/config-shard-introduction.rst
192+
193+
You cannot use the same config shard for multiple sharded clusters.
194+
195+
Commands
196+
~~~~~~~~
197+
198+
To configure a dedicated config server to run as a config shard, run the
199+
:dbcommand:`transitionFromDedicatedConfigServer` command.
200+
201+
To configure a config shard to run as a dedicated config server, run the
202+
:dbcommand:`transitionToDedicatedConfigServer` command.
203+
204+
Users
205+
~~~~~
206+
207+
A user created on a config shard has the same behavior as a user created
208+
on a dedicated config server.
209+
210+
Config Shard Identity Document
211+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212+
213+
A config shard has a document in the :data:`admin.system.version`
214+
collection to identify the config server as a config shard:
215+
216+
.. code-block:: javascript
217+
:copyable: false
218+
219+
{
220+
_id: 'shardIdentity',
221+
shardName: 'config',
222+
clusterId: ObjectId("<objectID>"),
223+
configsvrConnectionString: '<config server replica set connection string>',
224+
}
225+
226+
The following example retrieves a shard identity document from
227+
:data:`admin.system.version` in the :term:`admin database`:
228+
229+
.. code-block:: javascript
230+
231+
use admin
232+
db.system.version.find()
233+
234+
Output extract:
235+
236+
.. code-block:: javascript
237+
:copyable: false
238+
239+
{
240+
_id: 'shardIdentity',
241+
shardName: 'config',
242+
clusterId: ObjectId("6441bdd6779584849dcac095"),
243+
configsvrConnectionString: 'configRepl/localhost:27007'
244+
}
245+
246+
.. _sharded-cluster-config-server-config-shards-downgrade:
247+
248+
Downgrade Feature Compatibility Version
249+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250+
251+
If your cluster has a config shard and you need to downgrade the
252+
:ref:`feature compatibility version <view-fcv>` to earlier than 7.0,
253+
connect to :binary:`~bin.mongos` and use the :term:`admin database` and
254+
then perform this procedure:
255+
256+
.. procedure::
257+
:style: normal
258+
259+
.. step:: Run ``transitionToDedicatedConfigServer`` command
260+
261+
Example:
262+
263+
.. code-block:: javascript
264+
265+
db.adminCommand( {
266+
transitionToDedicatedConfigServer: 1
267+
} )
268+
269+
.. step:: Run ``movePrimary`` command
270+
271+
Syntax for :dbcommand:`movePrimary` command:
272+
273+
.. code-block:: javascript
274+
:copyable: false
275+
276+
db.adminCommand( { movePrimary: <databaseName>, to: <newPrimaryShard> } )
277+
278+
Replace ``databaseName`` and ``newPrimaryShard`` with your
279+
database name and new primary shard name.
280+
281+
The following example moves the primary shard in the ``test``
282+
database to the ``shard01`` primary shard:
283+
284+
.. code-block:: javascript
285+
286+
db.adminCommand( { movePrimary: "test", to: "shard01" } )
287+
288+
.. step:: Wait for balancer to move sharded collection data off config server
289+
290+
Run ``transitionToDedicatedConfigServer`` command again:
291+
292+
Example:
293+
294+
.. code-block:: javascript
295+
296+
db.adminCommand( {
297+
transitionToDedicatedConfigServer: 1
298+
} )
299+
300+
The response after a successful data move contains ``state:
301+
"completed"``. For full response details, see
302+
:dbcommand:`removeShard`.
303+
304+
.. step:: Run ``setFeatureCompatibilityVersion`` command
305+
306+
The following example sets the feature compatibility version to
307+
``6.0``:
308+
309+
.. code-block:: javascript
310+
311+
db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The following example assigns the ``clusterManager`` role to a user
2+
named ``testUser``:
3+
4+
.. code-block:: javascript
5+
6+
db.grantRolesToUser(
7+
"testUser",
8+
[ "clusterManager" ]
9+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. versionadded:: 7.0
2+
3+
Starting in MongoDB 7.0, you can:
4+
5+
- Configure a config server to store your application data in addition
6+
to the usual :term:`sharded cluster` metadata. A config server that
7+
stores application data is called a *config shard*.
8+
- Transition a config server between being a config shard and a
9+
dedicated config server.
10+
11+
A cluster requires a config server, but the server can be a config
12+
shard instead of a dedicated config server. Using a config shard reduces
13+
the number of nodes required and can simplify your deployment.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- :ref:`sharded-cluster-config-server-config-shards`
2+
- :ref:`modify-existing-user-access`

source/reference/built-in-roles.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ Cluster Administration Roles
253253
- :authaction:`setDefaultRWConcern` (New in version 4.4)
254254
- :authaction:`setFeatureCompatibilityVersion`
255255
- :authaction:`setFreeMonitoring`
256+
- :authaction:`transitionFromDedicatedConfigServer` (New in version 7.0)
257+
- :authaction:`transitionToDedicatedConfigServer` (New in version 7.0)
256258

257259
* - *All* :ref:`databases <resource-specific-db>`
258260

source/reference/command.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,18 @@ Sharding Commands
564564

565565
- Internal command that determines split points.
566566

567+
* - :dbcommand:`transitionFromDedicatedConfigServer`
568+
569+
- Configures a dedicated config server to run as a config shard.
570+
571+
.. versionadded:: 7.0
572+
573+
* - :dbcommand:`transitionToDedicatedConfigServer`
574+
575+
- Configures a config shard to run as a dedicated config server.
576+
577+
.. versionadded:: 7.0
578+
567579
* - :dbcommand:`unsetSharding`
568580

569581
- *Removed in MongoDB 5.0.* Internal command that affects

source/reference/command/nav-sharding.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ Sharding Commands
178178

179179
- Internal command that determines split points.
180180

181+
* - :dbcommand:`transitionFromDedicatedConfigServer`
182+
183+
- Configures a dedicated config server to run as a config shard.
184+
185+
.. versionadded:: 7.0
186+
187+
* - :dbcommand:`transitionToDedicatedConfigServer`
188+
189+
- Configures a config shard to run as a dedicated config server.
190+
191+
.. versionadded:: 7.0
192+
181193
* - :dbcommand:`unsetSharding`
182194

183195
- *Removed in MongoDB 5.0.* Internal command that affects
@@ -226,5 +238,7 @@ Sharding Commands
226238
/reference/command/shardingState
227239
/reference/command/split
228240
/reference/command/splitVector
241+
/reference/command/transitionFromDedicatedConfigServer
242+
/reference/command/transitionToDedicatedConfigServer
229243
/reference/command/unsetSharding
230244
/reference/command/updateZoneKeyRange
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
===================================
2+
transitionFromDedicatedConfigServer
3+
===================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. dbcommand:: transitionFromDedicatedConfigServer
17+
18+
.. include:: /includes/config-shard-introduction.rst
19+
20+
The ``transitionFromDedicatedConfigServer`` command configures a
21+
dedicated config server to run as a config shard.
22+
23+
Before you run ``transitionFromDedicatedConfigServer``, connect to
24+
:binary:`~bin.mongos` and use the :term:`admin database`.
25+
26+
The sharded cluster must have :ref:`featureCompatibilityVersion
27+
<view-fcv>` set to at least ``7.0``.
28+
29+
Syntax
30+
------
31+
32+
Command syntax:
33+
34+
.. code-block:: javascript
35+
:copyable: false
36+
37+
db.adminCommand( {
38+
transitionFromDedicatedConfigServer: 1
39+
} )
40+
41+
Behavior
42+
--------
43+
44+
After ``transitionFromDedicatedConfigServer`` completes, an entry is
45+
added to the :data:`config.shards` collection with ``_id: "config"`` for
46+
the config shard. An entry in ``config.shards`` means the config server
47+
can store application data like a typical shard.
48+
49+
To see a list of the shards in the cluster, run the
50+
:dbcommand:`listShards` command.
51+
52+
If you must downgrade the :ref:`feature compatibility version
53+
<view-fcv>` below 7.0, you must first run the
54+
:dbcommand:`transitionToDedicatedConfigServer` command. For downgrade
55+
details, see
56+
:ref:`sharded-cluster-config-server-config-shards-downgrade`.
57+
58+
Access Control
59+
--------------
60+
61+
If access control is enabled, the
62+
``transitionFromDedicatedConfigServer`` command requires the
63+
:authaction:`transitionFromDedicatedConfigServer` authorization action
64+
for the :ref:`cluster <resource-document>`:
65+
66+
.. code-block:: javascript
67+
:copyable: false
68+
69+
{
70+
resource: { cluster : true },
71+
actions: [ "transitionFromDedicatedConfigServer" ]
72+
}
73+
74+
The :authrole:`clusterManager` role has
75+
``transitionFromDedicatedConfigServer`` authorization action and can be
76+
assigned to a user.
77+
78+
.. include:: /includes/config-shard-add-role.rst
79+
80+
Example
81+
-------
82+
83+
The following example configures a dedicated config server to run as a
84+
config shard:
85+
86+
.. code-block:: javascript
87+
88+
db.adminCommand( {
89+
transitionFromDedicatedConfigServer: 1
90+
} )
91+
92+
Learn More
93+
----------
94+
95+
.. include:: /includes/config-shard-learn-more.rst

0 commit comments

Comments
 (0)