Navigation

Deploy a Sharded Cluster

Overview

Sharded clusters provide horizontal scaling for large data sets and enable high throughput operations by distributing the data set across a group of servers. See the Sharding Introduction in the MongoDB manual for more information.

Use this procedure to deploy a new sharded cluster managed by Ops Manager. Later, you can use Ops Manager to add shards and perform other maintenance operations on the cluster.

Unique Names for Deployment Items

Use unique names for the new cluster and its shards.

Important

Replica set, sharded cluster, and shard names within the same group must be unique. Failure to have unique names for the deployment items will result in broken backup snapshots.

Prerequisites

You must provision servers onto which to deploy, and Ops Manager must have access to the servers.

Important

If you will run MongoDB Enterprise and provision your own Linux servers, then you must manually install a set of dependencies to each server before installing MongoDB. The MongoDB manual provides the appropriate command to install the dependencies. See the link for the server’s operating system:

Procedure

1

Click Deployment, then the Processes tab.

2

Choose New Cluster.

  1. Click the New Deployment dropdown menu.
  2. Select New Cluster.
3

Configure the sharded cluster.

In the Cluster Configuration section, complete the following fields.

Name Type the name for your standalone MongoDB deployment.
Version

Select the MongoDB version for your standalone MongoDB deployment.

Note

If the dropdown menu does not include the MongoDB version you want for your deployment, you must enable it in the Version Manager.

Auth Schema Version Select the schema for storing the user data for your deployment. If you are upgrading from a MongoDB version older than 3.0, MongoDB 3.0 uses a different schema for user data than previous versions. For compatibility information, see the Security Changes in the MongoDB 3.0 release notes.
Feature Compatibility (Optional) Select the feature compatibility set. This field appears if your deployment MongoDB version is 3.4 or later.
Eligible Server RegExp

Type a Perl-compatible regular expression that includes the hostnames of the servers to which Ops Manager deploys MongoDB.

  • To use any of your provisioned servers, enter a period (“.”).
  • To use a specific set of servers, enter a part of the hostnames corresponding to a regular expression you specify.
  • To use your local server, enter its hostname.

Example

You have provisioned three servers:

  • westdev-01a-mongodb.example.com
  • centraldev-01b-mongodb.example.com
  • eastdev-03e-mongodb.example.com

To create one replica set using all of these servers, you would enter .*\-mongodb\.example\.com.

Data Node Eligible Port Range Type lower and upper values of IANA port numbers for your MongoDB deployment. Ops Manager assigns each member of your replica set a port number within this range.
# of Mongos Type the number of mongos processes you want deployed for your cluster.
Mongos Distribution

Select how you want your mongos processes deployed in your cluster:

On a data node

Ops Manager deploys the mongos on the same servers as existing data nodes.

Important

Production systems should use dedicated hosts for config servers.

On a dedicated node
Ops Manager deploys the mongos on their own servers.
Regular Expression

Ops Manager deploys the mongos on servers corresponding to a regular expression you specify.

If you select Regular Expression, another field, Mongos RegExp, appears. Type the regular expression to identify the servers in this field.

Mongos Eligible Port Range Type lower and upper values of IANA port numbers for your MongoDB deployment. Ops Manager assigns each mongos a port number within this range. The default port number is 27017.
# of Config Servers Type the number of mongod processes you want deployed for your config server replica set. The default is 3 and the maximum is 50. Only 7 members of a replica set can vote.
Config Server Distribution

Select how you want your config server mongod processes deployed in your cluster:

On a data node
Ops Manager deploys the config server mongod processes on the same servers as existing data nodes.
On a dedicated node
Ops Manager deploys the config server mongod processes on their own servers.
Regular Expression

Ops Manager deploys the mongos on servers corresponding to a regular expression you specify.

If you select Regular Expression, another field, Config Server RegExp, appears. Type the Perl- compatible regular expression to identify the server in this field.

Note

A replica set can have up to 50 members, but only 7 voting members. Set the number of voting members to an odd number to allow a majority vote for primary elections. For how to select voting members, see Non-Voting Members.

Config Server Eligible Port Range Type lower and upper values of IANA port numbers for your MongoDB deployment. Ops Manager assigns each member of your replica set a port number within this range. The default port number is 27019.
Config Server Replica Set Name Type the name of the replica set.
4

Configure the shards.

In the Shard Configuration section, complete the following fields.

Shard Count Set the number of shards you want in your cluster. If you want to distribute documents across a cluster, you must set this number to 2 or more.
MongoDs Per Shard Set the number of mongod processes (replica set members) you want for each of your shards.
Member Options

Configures replica set members. By default, each member is a voting member that bears data.

You may select a new member type from the dropdown menu:

You can change the election parameters of each member:

  • Change the number of votes the member has and
  • Change the member’s priority.

Click Add to add another member to the shard.

Shard Name Prefix Type the prefix you want each shard name to include.
DB Directory Path Prefix Type the beginning of the system path to the database directory for this process. The default is /data.
5

Set any advanced configuration options for your MongoDB sharded cluster.

In the Advanced Options section, add any additional runtime options you want to set for your MongoDB deployment.

To add an option:

  1. Click Add Option.
  2. Select a Startup Option.
  3. Set an acceptable value for that Startup Option.

For descriptions of Advanced Options, see Advanced Options for MongoDB Deployments.

6

Click Apply.

7

Optional. Make changes before you deploy.

If needed, you can reconfigure processes and change the topology.

To modify settings for a MongoDB process:

  1. Click the Processes tab.
  2. On the line listing the process, click Modify.
  3. Make changes as desired and click Apply.

To move a process to a different server:

  1. Click the Servers tab.

    Note

    The colored bar on the right of each server indicates the replica set or sharded cluster to which the server belongs.

  2. Drag and drop the process to a different server.

8

Click Review & Deploy to review your changes.

9

Review and approve your changes.

Ops Manager displays your proposed changes.

  1. If you are satisfied, click Confirm & Deploy.
  2. Otherwise, click Cancel and you can make additional changes.