Skip to content
RU

Port 27018: MongoDB sharded cluster

Key idea:

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.

Check your host & ports →

What runs on this port

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.

Security considerations

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.

Check this port online

Check port online →

Enterno.io Ping + Port checker tests TCP reachability of any port from 3 regions (Moscow / Frankfurt / Virginia).

Understanding MongoDB Sharded Clusters and Port 27018 Usage

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:

  • Port 27017: This is the default port for the mongos router and standalone instances.
  • Port 27018: Utilized by shard members, it ensures that data can be efficiently retrieved and stored across multiple shards.
  • Port 27019: This port is reserved for the config servers, which store metadata and configuration settings for the cluster.

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.

Security Considerations for Port 27018 in MongoDB

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:

  • Network Security Groups: Use network security groups (NSGs) or firewalls to restrict access to port 27018. Only allow trusted IP addresses or ranges to connect.
  • Authentication: Enable authentication for MongoDB to ensure that only authorized users can access the database. Use mechanisms like SCRAM or X.509 certificates.
  • Encryption: Implement TLS/SSL encryption for data in transit to protect sensitive information being transmitted over port 27018.
  • Regular Updates: Keep MongoDB and its dependencies updated to the latest stable versions to mitigate vulnerabilities.

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.

Practical Examples of Configuring MongoDB with Port 27018

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/shard1

This 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 27018

3. **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.

ICMP PingHost availability and latency
Port ScannerOpen TCP port detection
LatencyResponse time in milliseconds
Packet LossPercentage of dropped packets

Why teams trust us

ICMP+TCP
check protocols
14
key ports scanned
2,014
checks in 30 days
3
regions

How it works

1

Enter IP or domain

2

ICMP packets sent

3

Latency & packet loss shown

How Do Ping and Port Scanning Work?

Ping sends ICMP packets to a host and measures response time. Port scanning checks which TCP ports are open and accepting connections — helping diagnose serviceavailability issues.

Configurable Ping

Choose packet count (3, 4, 6, 10). Stats: min/avg/max latency and packet loss.

Common Port Scanner

Check 14 key ports: HTTP, HTTPS, SSH, FTP, SMTP, MySQL, PostgreSQL, and more.

Cloud-Based Check

Testing from our server — see site availability from outside, not just your local network.

Uptime Monitoring

Need constant monitoring? Create a monitor — checks every minute with notifications.

Who uses this

DevOps

availability diagnosis

Network engineers

TCP port scanning

Developers

connection debugging

SRE

basic health check

Common Mistakes

ICMP blocked = server is downMany servers block ICMP. Ping fails but site works — check ports instead.
High ping = server problemLatency depends on geography. 150ms between continents is normal, not an error.
Closed ports — cause for alarmClosed ports of unused services are good. Unnecessary open ports are a risk.
One check = sufficientNetworks are unstable. A single timeout ≠ a problem. Check multiple times or set up monitoring.

Best Practices

Combine ping and port checksPing shows host availability, ports show specific service availability. Use both.
Check from different locationsThe problem may be local. A cloud test shows the real picture.
Close unused portsEvery open port is a potential attack vector. Keep only necessary ports open.
Set up monitoringManual checks do not scale. Set up automated monitoring with notifications.

Get more with a free account

Ping check history, host availability monitoring and downtime alerts.

Sign up free

Learn more

Frequently Asked Questions

Is port 27018 open by default?

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.

How to check if port 27018 is reachable?

Use Enterno Ping + Port Checker. Or in shell: nc -vz example.com 27018.

Is port 27018 safe to expose?

Depends on the service. MongoDB sharded cluster should never be exposed publicly without authentication + TLS. See our 2026 exposure research.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.