The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
To build a production-shaped sharded MongoDB cluster on Ubuntu VPS instances, deploy a config-server replica set, one or more three-member shard replica sets, and redundant mongos routers. Install the same MongoDB major version everywhere, connect the nodes over private DNS and networking, enable internal authentication before allowing remote connections, then register the shards through mongos. A single-shard arrangement is suitable for development; production reference architecture uses three config-server members and three members for every shard.
What a sharded MongoDB cluster contains
MongoDB describes a sharded cluster as three cooperating component types: shards, mongos routing processes, and config servers. A shard stores a subset of the cluster’s data. The config-server replica set stores metadata such as database and collection placement and chunk information. A mongos process is the client-facing query router: it reads cluster metadata, sends operations to the relevant shard or shards, and returns the results to the application.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsThe database processes on the VPS instances are mongod. Each shard normally runs several mongod members as a replica set, and each config-server member is also a mongod configured with the configsvr role. mongos is stateless compared with those replica sets, so more than one router can be run when applications need router failover.
MongoDB 8.0 also documents a config-shard design in which a shard can hold config data. This guide uses the dedicated config-server replica-set layout because it is easier to reason about when creating a first cluster and matches the conventional production topology.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
How many Ubuntu VPS instances do you need?
The number depends on whether the cluster is for a test environment or production and on how many shards you plan to operate. The following counts describe separate VPS instances for each role; co-locating roles changes the physical count but also creates a larger failure domain.
| Design | Config servers | Members per shard | mongos routers |
Typical purpose |
|---|---|---|---|---|
| Development or test | One config replica set with a minimal layout | One shard replica set with a minimal layout | One | Learning, configuration validation, and application testing |
| Production reference layout with one shard | Three-member replica set | Three-member replica set | One or more | Fault-tolerant starting point for a single production shard |
| Production layout with multiple shards | Three-member replica set | Three members for each shard replica set | One or more, sized for client traffic | Horizontal data and write distribution with replica-set redundancy |
With one shard and one separately hosted router, the production-shaped example has seven VPS instances: three config members, three shard members, and one router. Adding a second shard adds another three shard members. MongoDB recommends distributing production config and shard replica-set members across at least three data centers when feasible, so a VPS provider’s independent zones are preferable to placing every member in one zone.
More shards increase operational work as well as capacity. You must maintain another replica set, monitor its replication, and choose a shard key that distributes its data and traffic. Additional mongos routers improve router availability, but they do not replace replica-set redundancy for shards or config servers.
Plan the VPS network before installing MongoDB
Use stable names and private paths
Give every VPS a stable DNS name on a private network, such as cfg1.internal, cfg2.internal, cfg3.internal, shard1a.internal, and router1.internal. Use those names in replica-set and sharded-cluster configuration instead of changing raw public IP addresses. Ensure forward and reverse resolution works from every member before initiating a replica set.
MongoDB binds to localhost by default. That safe default prevents remote members from connecting, so each process must explicitly bind to localhost plus the approved private hostname or address. Do not expose shard or config-server ports to the public internet. Permit only the required private traffic between cluster members, and permit application clients to reach the routers rather than the internal mongod processes.
Prepare operating-system prerequisites
- Use a supported 64-bit Ubuntu LTS image. MongoDB 8.0 documents Ubuntu 20.04, 22.04, and 24.04 on x86_64, with support for selected ARM64 platforms.
- Use the same MongoDB major version on every config server, shard member, and router.
- Provide private inter-node connectivity, synchronized clocks, storage with adequate I/O performance, and a tested backup destination.
- Apply host and provider firewall rules before binding MongoDB beyond localhost.
- Record the DNS names, private addresses, replica-set names, ports, and intended data-center placement in an inventory.
Synchronised clocks matter for log correlation, elections, certificates, and incident diagnosis. Keep operating-system updates and MongoDB package versions consistent across a replica set; do not upgrade one member to a new major release casually.
Recommended Free Tools
Install MongoDB 8.0 packages on Ubuntu
The official MongoDB packages are installed through an APT repository and its signing key. Select the repository that matches the Ubuntu LTS release rather than copying a repository entry for a different codename.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
- Confirm the operating system and architecture with the Ubuntu release information and
dpkg --print-architecture. - Install the repository prerequisites:
sudo apt-get update
sudo apt-get install -y gnupg curl - Import the MongoDB 8.0 signing key using the current official installation instructions, storing the de-armored key in the system keyring used by APT.
- Create
/etc/apt/sources.list.d/mongodb-org-8.0.listwith the MongoDB 8.0 repository for Noble (Ubuntu 24.04), Jammy (22.04), or Focal (20.04), matching the machine’s release. - Refresh package metadata and install the same package set on every node:
sudo apt-get update
sudo apt-get install -y mongodb-org - When repeatable builds are important, pin the package versions after reviewing the current MongoDB release documentation. Keep a record of the exact version installed so a replacement VPS can be rebuilt consistently.
Do not start production traffic immediately after installation. First apply the role-specific configuration, authentication settings, firewall rules, and private bind addresses described below. Repeat the installation and version check on every member before initiating any replica set.
Configure the config-server replica set
Create a shared internal-authentication secret
For development or testing, a keyfile can provide internal authentication between cluster members. Generate it once on a protected administrative system, transfer it securely to every mongod and mongos, set ownership to the MongoDB service account, and restrict its permissions so only that account can read it. Every process must use the identical file contents.
Keyfiles have limited manageability and cryptographic strength and are intended mainly for testing and development. For production, plan TLS with X.509 or another enterprise authentication mechanism such as LDAP proxy authentication or Kerberos where appropriate. Whichever mechanism you choose, configure it consistently on every member before allowing remote connections.
Assign the config-server role
On each of the three config VPS instances, edit the MongoDB configuration file. The following is an illustrative arrangement; use your own DNS names and approved ports.
storage:
dbPath: /var/lib/mongodb
net:
port: 27019
bindIp: localhost,cfg1.internal
replication:
replSetName: cfgRS
sharding:
clusterRole: configsvr
security:
keyFile: /etc/mongodb-keyfile
authorization: enabled
Use the same replication.replSetName, sharding.clusterRole: configsvr, authentication settings, and port on all config members. Change only the hostname in each member’s net.bindIp. Start or restart the service after validating the file, and check the service log for bind, permission, and authentication errors.
Initiate the config replica set
Connect to one config member with mongosh and initiate the set once. The replica-set identifier in the command must match replication.replSetName, and the configuration must mark the set as a config server.
rs.initiate({
_id: "cfgRS",
configsvr: true,
members: [
{ _id: 0, host: "cfg1.internal:27019" },
{ _id: 1, host: "cfg2.internal:27019" },
{ _id: 2, host: "cfg3.internal:27019" }
]
})
Run rs.status() and wait for one primary and healthy secondaries before proceeding. A production config-server replica set should have at least three members. Its metadata is critical: if a primary cannot be elected, metadata becomes read-only and chunk migrations or splits stop; if all config servers are unavailable, the cluster can become inoperable.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Configure each shard as its own replica set
Every shard has a unique replica-set name and uses sharding.clusterRole: shardsvr. For example, a first shard could use shardRS1 and three members on private names.
storage:
dbPath: /var/lib/mongodb
net:
port: 27018
bindIp: localhost,shard1a.internal
replication:
replSetName: shardRS1
sharding:
clusterRole: shardsvr
security:
keyFile: /etc/mongodb-keyfile
authorization: enabled
Use the same shard replica-set name and role on all three members, changing each member’s hostname. A second shard must use a different replica-set name, such as shardRS2. Start all members, then connect to one member in each set and initiate it.
rs.initiate({
_id: "shardRS1",
members: [
{ _id: 0, host: "shard1a.internal:27018" },
{ _id: 1, host: "shard1b.internal:27018" },
{ _id: 2, host: "shard1c.internal:27018" }
]
})
Check rs.status() on every shard and wait for a stable primary and synchronised secondaries. Do not add an unhealthy replica set to the cluster; a router can expose a partially initialised shard to applications and make diagnosis harder.
Deploy and connect the mongos router
Install the same MongoDB package version on a router VPS. Configure mongos with the config-server connection string in <configReplicaSet>/<host:port> form. For the example names above, the value is:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →sharding:
configDB: cfgRS/cfg1.internal:27019,cfg2.internal:27019,cfg3.internal:27019
security:
keyFile: /etc/mongodb-keyfile
Bind the router to its private address and, if applications connect from another network, to the specific interface or address allowed by the firewall. Keep internal mongod ports inaccessible to application clients. Start the router and connect with mongosh through the router rather than directly to a shard when performing cluster-level operations.
Deploy more than one router when router availability matters. Applications should have a connection strategy that can try another router if one VPS is down. Routers cache metadata and refresh it as the cluster changes, so monitor connectivity and stale-metadata warnings after adding shards or changing the network.
Register shards and enable sharding
Add each shard through mongos
From a shell connected to the router, add a shard with its replica-set connection string. This example registers the first three-member shard:
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
sh.addShard("shardRS1/shard1a.internal:27018,shard1b.internal:27018,shard1c.internal:27018")
Repeat the operation for each additional shard, using its own replica-set name and members. Verify the result with:
db.adminCommand({ listShards: 1 })
The output should show every intended shard and its replica-set name. Resolve authentication, DNS, or firewall failures before creating sharded collections.
Choose a shard key from workload evidence
Enabling sharding for a database does not automatically make every collection distributed. First enable the database, then shard selected collections through mongos:
sh.enableSharding("orders")
sh.shardCollection("orders.events", { customerId: 1 })
customerId is only an example field, not a universal recommendation. Select a key after measuring the application’s queries and writes. Evaluate:
Free tools Windows power users keep installed
One-click scans. No signup required.
- Query targeting: important operations should include the shard key when possible, so the router can target the relevant shard instead of broadcasting.
- Cardinality: a key needs enough distinct values to create useful distribution.
- Write distribution: avoid a pattern that sends most new writes to one shard.
- Range behavior: understand whether nearby key values are likely to accumulate on the same shard.
- Data model fit: changing a shard key later can be disruptive, so validate it against expected growth and access patterns.
Uniqueness alone is not a reason to choose a key. A unique field can still produce poor query targeting or an imbalanced write pattern.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Secure communication between VPS nodes
Apply network controls before binding publicly
MongoDB’s processes listen on localhost by default. Before adding a private or public address to net.bindIp, restrict the firewall to the exact source networks and ports required by config members, shard members, routers, administrators, and application clients. Never treat a public bind address as an authentication boundary.
Use private interfaces for replica-set and config-server traffic. Expose only the router address needed by clients, and place administrative access behind a VPN, bastion, or equivalent control. Review provider-level security groups as well as Ubuntu’s host firewall because either layer can accidentally permit the entire internet.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Enable authentication and authorization everywhere
Enable internal authentication on every mongod and mongos, not just on the routers. Use role-based access control for client accounts and keep administrative credentials separate from application credentials. For intra-cluster SCRAM on MongoDB 5.3 and later, use SCRAM-SHA-256. Production deployments should consider TLS/X.509 or another strong mechanism instead of relying on a development keyfile.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallAuthentication does not encrypt traffic by itself. If traffic crosses a provider network, data-center boundary, or any path you do not fully control, configure TLS and validate certificates and hostnames. Rotate credentials and certificates through a documented maintenance procedure rather than editing one member at a time without a rollback plan.
Backups, monitoring, and failure testing
Protect config metadata as well as shard data
Back up config-server data before maintenance and include it in the restore plan. The config database records the metadata that tells routers where data belongs; a backup strategy that covers only shard data is incomplete. Define retention, encryption, access controls, and an off-site or cross-zone destination, then perform a restore rehearsal before production traffic.
Monitor the signals that reveal an unhealthy cluster
- Replica-set health, replication lag, and repeated elections on config and shard sets
- Disk capacity and I/O pressure on every
mongodVPS - Chunk balancing activity and persistent imbalance between shards
mongosconnectivity, router restarts, and stale metadata warnings- Firewall drops, failed authentication, certificate errors, and DNS resolution failures
Exercise the failure paths
Before production, stop one secondary and confirm that the set remains available, then test a controlled primary election. Test a router failure by directing a client to another router. Verify that a config-primary failure behaves as expected and that metadata operations recover after a new primary is elected. Finally, test backup restoration and the documented procedure for replacing a failed VPS.
Do not infer high availability from a successful initial setup. A cluster is ready only when elections, router failover, restore procedures, and firewall behavior have been exercised under conditions close to the intended deployment.
Troubleshooting the first deployment
Members cannot join or initiate
- Confirm every hostname resolves from every member and that the advertised hostname is reachable on the private interface.
- Check that
net.bindIpincludes the private hostname and that the firewall permits the chosen port only from approved peers. - Verify that all members use the same replica-set name and MongoDB major version.
- Inspect service logs for keyfile ownership, file permissions, YAML indentation, and authentication errors.
The router cannot connect to the config servers
- Check that
sharding.configDBuses the exact config replica-set name and all member host-and-port pairs. - Confirm the router has the same internal-authentication secret or certificate configuration as the config servers.
- Connect directly with
mongoshfrom the router VPS to test DNS and private-network reachability.
Queries are slow or one shard is overloaded
- Check whether the query includes the shard key and whether the router is broadcasting it.
- Review key cardinality, write distribution, and range behavior rather than assuming that a unique field is balanced.
- Inspect chunk balancing, replication lag, disk pressure, and stale metadata warnings before adding more VPS instances.
Practical build order
- Provision Ubuntu VPS instances, private DNS, private networking, synchronized clocks, storage, backups, and firewall rules.
- Install the same MongoDB major version everywhere from the matching Ubuntu repository.
- Distribute the development keyfile or configure production TLS/X.509 and enable internal authentication consistently.
- Configure and initiate the three-member config-server replica set.
- Configure and initiate each three-member shard replica set.
- Configure and start one or more
mongosrouters with the config replica-set connection string. - Connect to
mongos, add the shard replica sets, and verify withlistShards. - Enable sharding for the required database and shard collections only after selecting keys from measured query and write patterns.
- Run election, router-failover, backup-restore, DNS, and firewall tests before accepting production traffic.
This order keeps metadata, data storage, and routing responsibilities separate and gives each layer a health check before the next one depends on it.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

