- API >
- Public API Resources >
- Deployments >
- Clusters
Clusters¶
On this page
Overview¶
MongoDB supports two types of clusters: replica sets and sharded clusters. A sharded cluster can contain replica sets within it: each shard can be a replica set and the config server can also be a replica set. These relationships are reflected in the way Ops Manager models clusters, and it might lead to unexpected results from the Clusters resource. As an example, consider a deployment with one sharded cluster containing four shards, and each shard is a three-node replica set. In this scenario, the Clusters resource will return five entities: one that represents the sharded cluster, and four to represent the replica sets (shards). However, if each shard in this fictitious deployment was a standalone mongod instead of a replica set, then the Clusters resource would only return one entity representing the sharded cluster.
Endpoints¶
Get All Clusters¶
Get all clusters in a group.
Use the parentClusterId
query parameter to get all clusters with the
specified parent cluster ID. The list of entities is sorted in ascending
order by the date that Ops Manager discovered the cluster.
Get a Cluster¶
Get a single cluster by ID.
Update a Cluster¶
Update a cluster by ID. The only property that you may modify is the
clusterName
, since Ops Manager discovers all other cluster properties.
This operation is only available on clusters of
type SHARDED
and SHARDED_REPLICA_SET
.
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
id |
string | Unique identifier. |
groupId |
string | ID of the group that owns this cluster. |
typeName |
string | Specifies what kind of cluster this is. Possible values are:
|
clusterName |
string | Display name of the cluster. Only applies to sharded clusters. Note that
mongod itself doesn’t allow you to name a cluster; this name is
supplied by (and editable within) Ops Manager. For a replica set within a sharded
cluster, the cluster name is the name of its parent cluster. |
shardName |
string | Name of the shard. Only present for a cluster of type SHARDED or
REPLICA_SET that is part of a sharded cluster. |
replicaSetName |
string | Name of the replica set. Only present for a cluster of type
REPLICA_SET or CONFIG_SERVER_REPLICA_SET . |
lastHeartbeat |
date | The approximate last time Ops Manager processed a ping from this cluster. |
Links¶
Relation |
Description |
---|---|
self |
Me |
http://mms.mongodb.com/parentCluster |
The parent cluster. Only present if the type is SHARDED or
REPLICA_SET within a sharded cluster. |
http://mms.mongodb.com/group |
The group that this cluster belongs to. |
http://mms.mongodb.com/clusters |
The member shards that belong to this cluster. Only present if the type
is SHARDED_REPLICA_SET . |
http://mms.mongodb.com/hosts |
The member hosts that belong to this cluster. Present for all types
except SHARDED_REPLICA_SET . Note: to get the hosts of a sharded
cluster, follow the clusters link and get the hosts for each
shard. |