- API >
- Public API Resources >
- Clusters
Clusters¶
On this page
MongoDB supports two different kinds of clusters: replica sets and sharded
clusters. Since a shard within a sharded cluster is typically a replica set,
a sharded cluster is a cluster of clusters. This relationship is 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.
Operations¶
GET /api/public/v1.0/groups/GROUP-ID/clusters/CLUSTER-ID
- Get a single cluster by ID.GET /api/public/v1.0/groups/GROUP-ID/clusters
- Get all clusters in a group. Note that if Ops Manager hasn’t received a ping from a cluster in several days, it will be considered inactive and will be filtered from this list. Use theparentClusterId
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.PATCH /api/public/v1.0/groups/GROUP-ID/clusters/CLUSTER-ID
- Update a cluster by ID. The only property that you may modify is theclusterName
, since all other properties of a cluster are discovered by Ops Manager. Additionally, this operation is only permitted on clusters of typeSHARDED
andSHARDED_REPLICA_SET
.
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
id | string | Unique identifier. |
groupId | string | ID of the group that owns this cluster. |
typeName | enum | 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 . |
lastHeartbeat | date | The approximate last time Ops Manager processed a ping from this cluster. |
Links¶
Relation | Description |
---|---|
self | Me |
parentCluster | The parent cluster. Only present if the type is SHARDED or
REPLICA_SET within a sharded cluster. |
group | The group that this cluster belongs to. |
clusters | The member shards that belong to this cluster. Only present if the type
is SHARDED_REPLICA_SET . |
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. |