Skip to content

DOCS-1395 config server tutorials #865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions bin/htaccess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,49 @@ redirect-path: '/tutorial/configure-replica-set-tag-sets'
url-base: '/reference/replica-configuration'
type: 'redirect'
code: 301
outputs:
- 'v2.2'
---
redirect-path: '/tutorial/manage-sharded-cluster-config-server'
url-base: '/administration/sharded-clusters'
type: 'redirect'
code: 301
outputs:
- 'master'
- 'after-v2.2'
---
redirect-path: '/tutorial/deploy-config-servers'
url-base: '/tutorial/manage-sharded-cluster-config-server'
type: 'redirect'
code: 301
outputs:
- 'v2.2'
---
redirect-path: '/tutorial/migrate-config-servers-with-same-hostname'
url-base: '/tutorial/manage-sharded-cluster-config-server'
type: 'redirect'
code: 301
outputs:
- 'v2.2'
---
redirect-path: '/tutorial/migrate-config-servers-with-different-hostnames'
url-base: '/tutorial/manage-sharded-cluster-config-server'
type: 'redirect'
code: 301
outputs:
- 'v2.2'
---
redirect-path: '/tutorial/replace-config-server'
url-base: '/tutorial/manage-sharded-cluster-config-server'
type: 'redirect'
code: 301
outputs:
- 'v2.2'
---
redirect-path: '/tutorial/backup-sharded-cluster-metadata'
url-base: '/tutorial/manage-sharded-cluster-config-server'
type: 'redirect'
code: 301
outputs:
- 'v2.2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for remembering this, we definitely need to manage the redirect, however:

  • the redirect-path field is "take this path and redirect requests for it somewhere else." while url-base is the "somewhere else". So this is basically backwards. No big deal, I have to look at the header each time and repeat the "redirect-path is from url-base is to" mantra in my head while writing these rules.

  • outputs is the editions/versions of the manual where the redirect must exist. In the following regexp-ish statement, it's everything between the parens http://docs.mongodb.org/(manual|master|v2.2|...)/.* Think about the history of this page: the goal is to make sure that if we've published redirect-path for a given output, that we list it here. In this case I think we want manual and master.

    Redirects that don't include manual and master are typically for pages that we've added to the current release, and these redirects support the version flipper experience.

    Incidentally there are also fake outputs for before-<version> and after-<version>. which make it possible to specify groups of outputs more easily, and while we don't use many of them right now because we have a limited number of versions, we will have more in the future.

...
6 changes: 5 additions & 1 deletion source/administration/sharded-clusters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ Sharded Cluster Maintenance and Administration
:maxdepth: 1

/tutorial/administer-shard-tags
/tutorial/manage-sharded-cluster-config-server
/tutorial/deploy-config-servers
/tutorial/migrate-config-servers-with-same-hostname
/tutorial/migrate-config-servers-with-different-hostnames
/tutorial/replace-config-server
/tutorial/backup-sharded-cluster-metadata
/tutorial/manage-chunks-in-sharded-cluster
/tutorial/configure-sharded-cluster-balancer
/tutorial/manage-sharded-cluster-balancer
Expand Down
6 changes: 3 additions & 3 deletions source/faq/sharding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ is to:
- restore the dumped data into MongoDB.

See :dbcommand:`shardCollection`, :method:`sh.shardCollection()`,
:doc:`/administration/sharded-clusters`, the :ref:`Shard Key
<sharding-internals-shard-keys>` section in the
the :ref:`Shard Key <sharding-internals-shard-keys>` section in the
:doc:`/core/sharded-cluster-internals` document,
:doc:`/tutorial/deploy-shard-cluster`, and :issue:`SERVER-4000` for
more information.
Expand Down Expand Up @@ -247,7 +246,8 @@ the data will reside only on the new shard.
What is the process for moving, renaming, or changing the number of config servers?
-----------------------------------------------------------------------------------

.. see:: :ref:`sharding-procedure-config-server` which describes this process.
See :doc:`/administration/sharded-clusters` for information on
migrating and replacing config servers.

When do the ``mongos`` servers detect config server changes?
------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions source/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ Sharding
- :doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`
- :doc:`/tutorial/add-shards-to-shard-cluster`
- :doc:`/tutorial/remove-shards-from-cluster`
- :doc:`/tutorial/deploy-config-servers`
- :doc:`/tutorial/migrate-config-servers-with-same-hostname`
- :doc:`/tutorial/migrate-config-servers-with-different-hostnames`
- :doc:`/tutorial/replace-config-server`
- :doc:`/tutorial/backup-sharded-cluster-metadata`
- :doc:`/tutorial/backup-small-sharded-cluster-with-mongodump`
- :doc:`/tutorial/backup-sharded-cluster-with-filesystem-snapshots`
- :doc:`/tutorial/backup-sharded-cluster-with-database-dumps`
Expand Down
38 changes: 38 additions & 0 deletions source/tutorial/backup-sharded-cluster-metadata.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
=======================
Backup Cluster Metadata
=======================

.. default-domain:: mongodb

This procedure shuts down the :program:`mongod` instance of a
:ref:`config server <sharding-config-server>` in order to create a
backup of a :doc:`sharded cluster's </core/sharded-clusters>`
metadata. The cluster's config servers store all of the cluster's
metadata, most importantly the mapping from :term:`chunks <chunk>` to
:term:`shards <shard>`.

When you perform this procedure, the cluster remains operational
[#read-only]_.

#. Disable the cluster balancer process temporarily. See
:ref:`sharding-balancing-disable-temporally` for more information.

#. Shut down one of the config databases.

#. Create a full copy of the data files (i.e. the path specified by
the :setting:`dbpath` option for the config instance.)

#. Restart the original configuration server.

#. Re-enable the balancer to allow the cluster to resume normal
balancing operations. See the
:ref:`sharding-balancing-disable-temporally` section for more
information on managing the balancer process.

.. seealso:: :doc:`/core/backups`.

.. [#read-only] While one of the three config servers is unavailable,
the cluster cannot split any chunks nor can it migrate chunks
between shards. Your application will be able to write data to the
cluster. The :ref:`sharding-config-server` section of the
documentation provides more information on this topic.
46 changes: 46 additions & 0 deletions source/tutorial/deploy-config-servers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
======================================================
Deploy Three Config Servers for Production Deployments
======================================================

.. default-domain:: mongodb

This procedure converts a test deployment with only one
:ref:`config server <sharding-config-server>` to a production deployment
with three config servers.

For redundancy, all production :doc:`sharded clusters
</core/sharded-clusters>` should deploy three config servers on three
different machines. Use a single config server only for testing
deployments, never for production deployments. When you shift to
production, upgrade immediately to three config servers.

To convert a test deployment with one config server to a production
deployment with three config servers:

#. Shut down all existing MongoDB processes in the cluster. This
includes:

- all :program:`mongod` instances or :term:`replica sets <replica set>`
that provide your shards.

- all :program:`mongos` instances in your cluster.

#. Copy the entire :setting:`dbpath` file system tree from the
existing config server to the two machines that will provide the
additional config servers. These commands, issued on the system
with the existing :ref:`config-database`, ``mongo-config0.example.net`` may
resemble the following:

.. code-block:: sh

rsync -az /data/configdb mongo-config1.example.net:/data/configdb
rsync -az /data/configdb mongo-config2.example.net:/data/configdb

#. Start all three config servers, using the same invocation that you
used for the single config server.

.. code-block:: sh

mongod --configsvr

#. Restart all shard :program:`mongod` and :program:`mongos` processes.
Loading