Port 27018 (TCP) is the standard for MongoDB sharded cluster. Port 27018 — default for MongoDB shardsvr (shard member in a sharded cluster). 27017 — mongos router + standalone. 27019 — config server. Sharding is used for horizontal scal
Below: what uses this port, security considerations, online check, FAQ.
Free online tool — ping & port checker: instant results, no signup.
MongoDB sharded cluster
Port 27018 — default for MongoDB shardsvr (shard member in a sharded cluster). 27017 — mongos router + standalone. 27019 — config server. Sharding is used for horizontal scaling of DBs over 2 TB.
MongoDB without auth pre-3.6 — known ransomware target (2017 mass encryption). Enable auth via `security.authorization: enabled`, TLS for member + client, bind private network only.
Enterno.io Ping + Port checker tests TCP reachability of any port from 3 regions (Moscow / Frankfurt / Virginia).
Port 27018 (TCP) serves a critical function within a MongoDB sharded cluster. Specifically, it is the default port used for shard members, which are the individual components of a sharded setup. In a sharded architecture, data is distributed across multiple servers or shards, allowing for horizontal scaling, improved performance, and enhanced data management.
When deploying a MongoDB sharded cluster, it is essential to understand the role of each port:
When setting up a sharded cluster, ensure that port 27018 is open and accessible for all shard members to communicate effectively. Misconfigurations or firewalls blocking this port can lead to significant performance issues or even cluster failure.
Securing port 27018, like any other port in a database environment, is crucial to protect against unauthorized access and potential data breaches. Here are some best practices to enhance security when using port 27018 for MongoDB sharded clusters:
Additionally, consider monitoring access logs and setting up alerts for any suspicious activity targeting port 27018. By adhering to these security measures, you can significantly reduce the risk associated with using this port in a MongoDB sharded cluster.
When configuring a MongoDB sharded cluster, it is essential to specify the correct ports for each component. Below are some practical examples of how to set up your MongoDB instances to utilize port 27018 effectively.
1. **Starting a Shard Member**: To start a MongoDB shard member on port 27018, use the following command:
mongod --shardsvr --port 27018 --dbpath /data/shard1This command initializes the shard member, indicating it is part of a sharded cluster.
2. **Connecting to a Shard**: When connecting to a shard member from a client application, specify the port as follows:
mongo --host shard1.example.com --port 270183. **Configuring a Sharded Cluster**: To add the shard member to your existing sharded cluster, use the following command in the MongoDB shell:
sh.addShard('shard1.example.com:27018')4. **Checking Shard Status**: To verify that your shard is properly configured and accessible, you can run:
sh.status()This command provides an overview of the sharded cluster's status, including the connected shard members and their respective ports.
By following these examples, you can ensure that your MongoDB sharded cluster is configured correctly to utilize port 27018, facilitating efficient data distribution and retrieval.
No, modern cloud providers (AWS, Google Cloud, Yandex) close all incoming ports by default. You must explicitly allow port 27018 in a Security Group or firewall.
Use <a href="/en/ping">Enterno Ping + Port Checker</a>. Or in shell: <code>nc -vz example.com 27018</code>.
Depends on the service. MongoDB sharded cluster should never be exposed publicly without authentication + TLS. See <a href="/en/s/research-open-ports-exposure-2026">our 2026 exposure research</a>.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.