1. Home
  2. Docs
  3. ClusterControl
  4. User Guide (GUI)
  5. Dashboard
  6. Deploy a Database Cluster
  7. MongoDB Shards

MongoDB Shards

Deploys a new MongoDB Sharded Cluster. The database cluster will be automatically added to ClusterControl once deployed. For production deployment, it is recommended to have at least 8 nodes for high availability:

  • 2 nodes for the mongos (router),
  • 3 nodes for the config server replica set,
  • 3 nodes for the shard server replica set.

 

Attention

Starting from ClusterControl 1.9.7 (September 2023), ClusterControl GUI v2 is the default frontend graphical user interface (GUI) for ClusterControl. Note that the GUI v1 is considered a feature-freeze product with no future development. All new developments will be happening on ClusterControl GUI v2. See User Guide (GUI v2).

General & SSH Settings

Field Description
SSH User
  • Specify root if you have root credentials.
  • If you use sudo to execute system commands, specify the name that you wish to use here. The user must exist on all nodes. See Operating System User.
SSH Key Path
  • Specify the full path of SSH key (the key must exist in the ClusterControl node) that will be used by SSH User to perform passwordless SSH. See Passwordless SSH.
Sudo Password
  • If you use sudo with password, specify it here. Ignore this if SSH User is root or sudoer does not need a sudo password.
SSH Port
  • Specify the SSH port for target nodes. ClusterControl assumes SSH is running on the same port on all nodes.
Cluster Name
  • Specify a name for the cluster.
Install Software
  • Check the box if you use clean and minimal VMs. Existing MySQL dependencies will be removed. New packages will be installed and existing packages will be uninstalled when provisioning the node with the required software. – If unchecked, existing packages will not be uninstalled, and nothing will be installed. This requires that the instances have already provisioned the necessary software
Disable Firewall
  • Check the box to disable the firewall (recommended).
Disable AppArmor/SELinux
  • Check the box to let ClusterControl disable AppArmor (Ubuntu) or SELinux (RedHat/CentOS) if enabled (recommended).

Configuration Servers and Routers

Configuration Server

Field Description
Server Port
  • MongoDB config server port. Default is 27019.
Add Configuration Servers
  • Specify the IP address or hostname of the MongoDB config servers. A minimum of one node is required, recommended to use 3 nodes. The host must be different from the shard servers.

Routers/Mongos

Field Description
Server Port
  • MongoDB mongos server port. The default is 27017.
Add More Routers
  • Specify the IP address or hostname of the MongoDB mongos.

Define Shards

Field Description
Replica Set Name
  • Specify a name for this replica set shard.
Server Port
  • MongoDB shard server port. The default is 27018.
Add Node
  • Specify the IP address or hostname of the MongoDB shard servers. A minimum of one node is required, recommended to use 3 nodes. The host must be different from the config and router (mongos) servers.
Advanced Options
  • Click on this to open a set of advanced options for this particular node in this shard:
    • Add slave delay – Specify the amount of delayed slave in milliseconds format.
    • Act as an arbiter – Toggle to ‘Yes’ if the node is an arbiter node. Otherwise, choose ‘No’.
Add Another Shard
  • Create another shard. You can then specify the IP address or hostname of the MongoDB server that falls under this shard.

Database Settings

Field Description
Vendor
  • Percona – Percona Server for MongoDB by Percona
  • MongoDB – MongoDB Server by MongoDB Inc
Version
Server Data Directory
  • Location of MongoDB data directory. Default is /var/lib/mongodb.
Admin User
  • MongoDB admin user. ClusterControl will create this user and enable authentication.
Admin Password
  • Password for MongoDB Admin User.
Server Port
  • MongoDB server port. The default is 27017.
mongodb.conf Template
  • MongoDB configuration template file under /etc/cmon/templates or /usr/share/cmon/templates. See Base Template Files for details.
Repository
  • Use Vendor Repositories – Provision software by setting up and using the database vendor’s preferred software repository. ClusterControl will always install the latest version of what is provided by the database vendor repository.
  • Do Not Setup Vendor Repositories – Provision software by using repositories already set up on the nodes. The User has to set up the software repository manually on each database node and ClusterControl will use this repository for deployment. This is good if the database nodes are running without internet connections.
  • Use Mirrored Repositories – Create and mirror the current database vendor’s repository and then deploy using the local mirrored repository. This is a preferred option when you have to scale the MongoDB in the future, to ensure the newly provisioned node will always have the same version as the rest of the members.
Deploy
  • Starts the MongoDB Sharded Cluster deployment.
Was this article helpful to you? Yes No